Reputation: 795
I understand that Erlang process message is sync. When I do
Pid ! message
Which choice will the sending message thread do ?
Upvotes: 2
Views: 973
Reputation: 18849
In Erlang, message passing is asynchronous. The sender never blocks. Message delivery is not guaranteed. Caveats:
Upvotes: 2
Reputation: 1714
I believe your understanding might be wrong. Erlang message passing is asynchronous. For example have a look here. To answer your question then the option number 1 is what's happening here.
Upvotes: 3
Reputation: 10254
I think
the sending message thread return right now.
is right.
because Pid ! message
just put the message
into the message queue of process Pid
. the process Pid
will use receive
to check its message queue. this is nothing with the sending process.
Upvotes: 0