Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion From whence do monitors come?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matthew Sackman  
View profile  
 More options Sep 10 2010, 9:07 am
From: Matthew Sackman <matt...@wellquite.org>
Date: Fri, 10 Sep 2010 14:07:58 +0100
Local: Fri, Sep 10 2010 9:07 am
Subject: [erlang-questions] From whence do monitors come?
gen.erl has the following code in do_call:

            catch erlang:send(Process, {Label, {self(), Mref}, Request},
                  [noconnect]),
            receive
                {Mref, Reply} ->
                    erlang:demonitor(Mref, [flush]),
                    {ok, Reply};
                {'DOWN', Mref, _, _, noconnection} ->
                    exit({nodedown, Node});
                {'DOWN', Mref, _, _, Reason} ->
                    exit(Reason)

If the callee is something like a gen_server, and on handling that msg
returns a {stop, Reply, Reason, State} quple, there seems to be a race
between the reply and the monitor. Or more simply, say the callee does
something like:

receive {'$gen_call', From, _Msg} -> gen_server:reply(From, done) end.

There seems to be a race - what's stopping the DOWN from the monitor
overtaking the reply from the callee?

The only thing that I can think of is that the DOWN is considered to
come *from* the callee. Is that right?

Matthew

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questions-unsubscr...@erlang.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.