<html><head></head><body bgcolor="#FFFFFF"><div>Hello,</div><div><br></div><div>At general level this is</div><div>f(),</div><div>spawn(fun g/0),</div><div>g()<br><br>The major concern here is supervision of forked processes, forking of gen_server and making OTP compliment application. <br>
<br>Best Regards,<div>Dmitry >-|-|-*></div><div><br></div></div><div><br>On 7.9.2012, at 4.31, Xiao Jia <<a href="mailto:stfairy@gmail.com">stfairy@gmail.com</a>> wrote:<br><br></div><div></div><blockquote type="cite">
<div>Well, this approach can solve much of the problem.<br>Do you know if there's any approach which can clone the control flow as well as the states?<br><br>Of course in your example the control flow is cloned as you also <font face="courier new, monospace">loop</font> in the <font face="courier new, monospace">spawn fun</font>. <br>

But what I want is a more general case. Take the following C code as an example.<br><br><font face="courier new, monospace">f();<br>fork();<br>g();</font><br><br>Here the return value of <font face="courier new, monospace">fork()</font> is ignored, so the next steps of both the parent and the child <div>

process are the same, which is to execute <font face="courier new, monospace">g()</font>. Can I achieve this in Erlang?<br><br>2012/9/6 Bengt Kleberg <<a href="mailto:bengt.kleberg@ericsson.com">bengt.kleberg@ericsson.com</a>><br>

><br>> Greetings,<br>><br>> Suppose that you have a process running like this:<br>> loop( State ) -><br>> receive<br>> normal -><br>> New_state = new_state( State ),<br>