[erlang-questions] Imagine every (active) entity is a process
Tue Nov 6 10:17:16 CET 2007
Thanks a lot.
I am starting to get a better picture of what is possible.
Le 6 nov. 07 à 09:27, Ulf Wiger (TN/EAB) a écrit :
> Alexander Lamb wrote:
>> Isn't there a race condition here. Since I have to check first if
>> a process exists before creating it, I might end up in a situation
>> where two other processes are doing the same thing and creating
>> twice a process for the same entity. The second would obviously
>> fail and we could catch the error. But is this a correct way of
>> proceeding? Also, is it possible to have thousands of registered
>> processes (as opposed to non registered processes)?
> You will find a contrib called dispatcher at Trapexit.
> It does pretty much exactly what you're asking for, including
> taking care of the inherent race condition.
> Ulf W
4 ch. de la Tour de Champel
Tel: 022 347 77 37
Fax: 022 347 77 38
More information about the erlang-questions