[erlang-questions] Semantics of send

Dmitry Belyaev <>
Wed Apr 28 13:59:53 CEST 2010


Maybe I answered not clear enough.

If you use atom() instead of pid() it is like whereis(Atom) ! Msg.
So the code will fail if no process is registered with that name.
Still, no checks that the message is delivered.

Dmitry Belyaev wrote:
> The code will be executed without checks are those messages delivered.
> "Pid ! Msg" doesn't check whether process with that Pid exists.
>
> The only check is made if you use no pid() but atom() for registered 
> process.
>
> Johan Montelius wrote:
>>
>>
>>
>> What is the semantics of send?  In the following example:
>>
>> to_a_or_to_ab_or_to_none(A, B) ->
>>     A ! foo,
>>     B ! bar,
>>     crash().
>>
>> If B receives bar is it then so that A receives foo?
>>
>> And where is the behavior stated?
>>
>> Is it guaranteed by the Erlang implementation in a distributed setting?
>>
>> If the sender crashes, is disconnected ...
>>
>>  Johan
>>
>>
>>
>
>



More information about the erlang-questions mailing list