[erlang-questions] The implementation of link/1 and monitor/2

Torbjörn Lager torbjorn.lager@REDACTED
Fri Sep 12 15:22:24 CEST 2014


Hi there,

I have read about links and monitors in Erlang and think I'm beginning to
understand how they work. I'm a bit curious how they are implemented
though.

1. It seems to me that for a link between two processes P1 and P2, two
OTHER processes are needed, one watching over P1 and one watching over P2.
Is this how Erlang implements links?

2. It seems to me that a monitor is also a kind of process. Is it a regular
Erlang process of the kind you can spawn yourself?

3. Related: If Erlang didn't have link/1 and monitor/2 as BIFs, could they
be implemented in Erlang, or are they true language primitives?

4. Related: If Erlang had only monitor/2, could link/1 somehow be
implemented in terms of it?

Thanks,
Torbjörn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140912/cbf3b835/attachment.htm>


More information about the erlang-questions mailing list