[erlang-questions] Re: Question about register/2
Wed Apr 6 14:53:59 CEST 2011
On Wed, Apr 6, 2011 at 14:40, Arie van Wingerden <xapwing@REDACTED> wrote:
> when I issue register(id, spawn aFun) and id already is associated with
> some process, the function fails.
> What disturbs me is that the check of id already being taken for another
> pid, might take place *after* the spawn has been executed.
> Hence a "ghost" process is running.
> Is this the way it works? And how is this mostly solved?
The solution is to let the spawned process register itself right after
starting. If that fails, just let it die and theres is no ghost-process
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions