monitor vs link

Bengt Kleberg <>
Mon Apr 4 09:51:29 CEST 2005


asergey wrote:
> Hi Gurus,
> 
> Could you please explain the difference between
> erlang:monitor(process, Pid) and link(Pid) + process_flag(trap_exit,
> true)?

erlang:monitor/2 is one way. it allows your process to find out when Pid 
exits, without telling Pid if your process exits.

erlang:link/1 is two way. your process finds out about when Pid exits, 
and Pid finds out about your process exit.


bengt



More information about the erlang-questions mailing list