[erlang-questions] Message order and exit(Reason)

Dmitrii Dimandt dmitrii@REDACTED
Mon Jan 28 10:00:25 CET 2013

Hi all,

We've had a semi-heated discussion in Russian community over this question: http://stackoverflow.com/questions/14556109/race-condition-between-trap-exit-exit-msg-and-common-msg

The question is as following: Assume we have processes A and B which are linked. Process's A flag trap_exit is set to true. Let B process send a msg to A and then exit:

PidA ! 'msg',

What I wanna know if we can be shure that the process A will receive 'msg' and only after It {'EXIT', Pid, reason} will come ? Can we predict the ordering of msgs? I can't found any proofs in documentation, but I guess that it will work that way, but I need some proofs. Don't want to have race condition here.

Can anyone with the intimate knowledge of Erlang internals shed some light on this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130128/22219861/attachment.htm>

More information about the erlang-questions mailing list