Distributed spawn-linking.

Alex Arnon alex.arnon@REDACTED
Mon Aug 8 18:14:15 CEST 2005


On 8/8/05, Michael McDaniel <erlang@REDACTED> wrote:
> On Mon, Aug 08, 2005 at 05:51:42PM +0300, Alex Arnon wrote:
> > Hi All,
> >
> > A (newbie question):
> > Consider a somewhat convoluted architecture: I have two processes, the
> > Spawner and Overseer. The Spawner's role is to spawn processes, while
> > the overseer would link to them and manage their operation (sending
> > command messages and the like). My question is:
> >   if the Spawner does this:
> >
> >     Overseer ! {new, spawn(SomeNode, Behaviour, Args)}
> >
> >   and the Overseer then does:
> >
> >     receive
> >         {new, Pid} ->
> >             link(Pid),
> >             Pid ! {i_see_you, self()}
> >         ...
> >
> > Is there any chance that the link would fail/message would get lost
> > due to there not being a process yet? In other words, does spawn()
> > wait for SomeNode to respond with an ACK before returning?
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> googling "message passing acknowledge" shows ...
> 
> http://www.erlang.org/ml-archive/erlang-questions/200212/msg00284.html
> 
> 
> 

Thank you, but this does not answer my question, which is specifically
about the behaviour of spawn(). I shall reword:
- Is spawn(Node, ...) a synchronous operation? I.e. does the spawning
process wait for the target node to acknowledge and assign the PID
before returning?
- If not, does Erlang handle the original example? And if it does, how?



More information about the erlang-questions mailing list