[erlang-questions] spawn and controlling_process

Gadi Srebnik <>
Sat Nov 1 11:34:47 CET 2014


Hi all, my first question here.

How safe it is to use controlling_process after spawn? I am using
additional gen_tcp:controlling_process inside the Mod:Fun itself after few
additional commands. Is it possible that process will not be owner by then?


Pid = erlang:spawn(Mod, Fun, Args),

 gen_tcp:controlling_process(Socket,Pid),

Is one-liner safer?

gen_tcp:controlling_process(Socket,erlang:spawn(Mod, Fun, Args)),


Thanks,
Gadi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141101/388c0956/attachment.html>


More information about the erlang-questions mailing list