[erlang-questions] link/monitor rarely enough

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


Hi,

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  
Dull

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

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.
"

Thanks!
Sean



More information about the erlang-questions mailing list