[erlang-questions] Monitor option in spawn_opt/5

Motiejus Jakštys desired.mta@REDACTED
Sat Jul 27 13:03:44 CEST 2013


On Sat, Jul 27, 2013 at 1:05 PM, Michał Ptaszek <erlang@REDACTED> wrote:
> Hey,
>
> What is the reason for not allowing to pass 'monitor' option to processes
> spawned by erlang:spawn_opt/5?
>
> The code inside of erlang.erl states:
>
>     case lists:member(monitor, O) of
> false -> ok;
> true -> erlang:error(badarg, [N, M, F, A, O])
>     end,
>
> However the documentation does not clarify anything.
> Setting up a monitor on the returned pid right after spawn works fine
> though.

I guess the reason is that there is no way in Erlang to atomically
spawn and monitor the pid on another node. Though it's a bit strange
that [link] works on remote nodes, but [monitor] doesn't. Anyone care
to explain why?

-- 
Motiejus Jakštys



More information about the erlang-questions mailing list