[erlang-questions] link/monitor rarely enough

Sean Hinde <>
Tue Jan 23 20:52:46 CET 2007


I find myself writing more and more code where two processes must  
monitor each other in different ways. Example - two processes:  
Thing_1 and Thing_2.

Thing_1 must die if Thing_2 dies.
Thing_2 must receive a message if Thing_1 dies.

To do this with monitor/link is tedious and hard to get right,  
because as soon as one traps exits all sorts of other linked  
processes must be tracked by Pid and special actions taken. Dull Dull  

I end up using both monitor and link, with horrible cruft to track  

Please, the powers that be in Ericsson, implement the full mechanism  
described by Robert Virding on 22nd Oct last year:

"With links there are 3 parameters which describe the link:
signal/message, single/multiple and uni-/bidirectional. With link/1 you
get a signal-single-bidirectional connection berween the processes and
with monitor/1 you get a message-multiple-unidirectional connection. You
could of course have any combination of these parameters that you need.


More information about the erlang-questions mailing list