[erlang-questions] From whence do monitors come?

Matthew Sackman <>
Sat Sep 11 16:53:18 CEST 2010


On Sat, Sep 11, 2010 at 04:41:49PM +0200, Robert Virding wrote:
> It's the [flush] option to demonitor which saves you here. Apart from
> removing the monitor it automatically removes any monitor message form
> that process in the process mailbox.

No, you've misunderstood the problem. The problem is that unless the
DOWN message is considered to come *from* the terminating process, there
is no guarantee of the order in which the reply and the DOWN message
will arrive. The problematic case being the potential for the DOWN to
arrive before the reply.

> And yes the {'DOWN',...} message
> does work as a normal message.

Does that also hold for exit signals which are being sent to processes
that have trap_exit on?

Matthew


More information about the erlang-questions mailing list