[erlang-questions] Questions about PID of remote process
Ulf Wiger
ulf.wiger@REDACTED
Thu May 13 13:48:14 CEST 2010
Very true. I didn't mean 'immediately' as in the very same
period in the oscillation of a Cesium atom. :)
In the case of a remote process, obviously a request will have
to be sent to the node in question, which can 'immediately'
determine if the process is dead, and then send a reply back.
This is similar to the situation when you talk to a server,
which implies a monitor if you use gen_server:call().
If the call causes an exception due to a 'DOWN' message
from the server, you cannot know whether:
- the server was down before you even sent the message
- the server died while your message was in the queue,
waiting to be processed
- the server died when it looked at your message
- it had time to do most of the processing, possibly
involving side-effects, but before it had time to
respond.
BR,
Ulf W
On 05/13/2010 01:26 PM, Richard O'Keefe wrote:
>
> On May 13, 2010, at 5:50 PM, Ulf Wiger wrote:
>
>> On 05/13/2010 07:09 AM, 钱晓明 wrote:
>>> Hi, I have two questions about pid of remote process:
>>>
>>> 1. How do I know if the remote process identified by one PID is alive? I
>>> know I can send a message to it, and receive response with timeout.
>>> But I
>>> hope there is some way more conveniently.
>>
>> If you monitor it, you will be notified when it dies - or immediately
>> if it is already dead.
>
> Here's a possible scenario.
> T1: you learn about the existence of a remote process.
> T2: you monitor it.
> T3: it dies, and a message is launched to tell you that.
> T4: is *NOW*. According to the best possible information
> available to you, the process is still alive.
> T5: the death notice arrives.
>
> We inhabit a universe with a finite speed of light.
> Learn to live with it.
>
>
---------------------------------------------------
---------------------------------------------------
WE'VE CHANGED NAMES!
Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.
www.erlang-solutions.com
More information about the erlang-questions
mailing list