[erlang-questions] Sending message to process already listening on a socket

Tony Finch dot@REDACTED
Wed Aug 1 19:56:47 CEST 2007


On Wed, 1 Aug 2007, David Hopwood wrote:
>
> It is 1-1 FIFO; that is, messages are queued in FIFO order between
> any given pair of processes, but there are no other constraints on
> ordering.
>
> A brief explanation, so you don't necessarily have to read the
> whole paper: a pair (s, r) represents a message transmission where
> s is the send event, and r is the receive event. So Definition 3.3
> says that if two messages are sent by the same process (s ~ s') and
> received by the same process (r ~ r'), then they are received in
> the same order they were sent (s < s' => r' < r').

Um, those two paragraphs don't mean the same thing in the presence of
selective receive.

If s sends r two messages and r is waiting with a pattern that matches the
second and not the first, then your second paragraph says that the
messages cannot be delivered until some other process sends a message that
matches r's pattern, otherwise the ordering constraint on s's messages
would be violated.

If the ordering constraint only applies to enqueueing messages and not
dequeueing them (as your first paragraph implies) then r unblocks since it
can receive s's messages in the opposite order to which they were sent and
queued.

Tony.
-- 
f.a.n.finch  <dot@REDACTED>  http://dotat.at/
IRISH SEA: SOUTHERLY, BACKING NORTHEASTERLY FOR A TIME, 3 OR 4. SLIGHT OR
MODERATE. SHOWERS. MODERATE OR GOOD, OCCASIONALLY POOR.



More information about the erlang-questions mailing list