Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do You Determine The PID of the Parent of a Process

Tags:

erlang

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?

like image 663
ricree Avatar asked Aug 07 '08 01:08

ricree


1 Answers

You should pass self() to the child as one of the arguments to the entry function.

spawn_link(?MODULE, child, [self()]).
like image 92
Lily Ballard Avatar answered Oct 06 '22 11:10

Lily Ballard