Question
I have a process in erlang that is supposed to do something immediately after spawn, then send the result back to the parent when it is finished. How do I figure out the PID of the process that spawned it?
Answer
You should pass self() to the child as one of the arguments to the entry function.
spawn_link(?MODULE, child, [self()]).
< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/4287/" >How Do You Determine The PID of the Parent of a Process< /a>
0 comments:
Post a Comment