[erlang-questions] Singleton Process
Zvi
exta7@REDACTED
Fri Feb 6 00:32:29 CET 2009
Bernard Duggan-2 wrote:
>
> Hi Edward,
> Your code is a pretty reasonable attempt at a basic implementation (and
> I don't mean that in any derogatory or rude sense - much of my code from
> not very long ago follows a similar pattern).
> The most obvious problem I can see with it is the race condition in
> start() - if two processes call next_id() at the same time, they could
> both call whereis(counter) and receive 'undefined' as the response -
> they'd both then try to spawn and register the process,
Hi, Bernard
what's your suggested workarround for this problem?
I think the calls to whereis must be serialized in some way...
Zvi
--
View this message in context: http://www.nabble.com/Singleton-Process-tp21806559p21863642.html
Sent from the Erlang Questions mailing list archive at Nabble.com.
More information about the erlang-questions
mailing list