[erlang-questions] Imagine every (active) entity is a process

Alexander Lamb <>
Tue Nov 6 10:17:16 CET 2007


Thanks a lot.

I am starting to get a better picture of what is possible.

Alex

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.
>
> http://forum.trapexit.org/viewtopic.php?p=30165#30165
>
> BR,
> Ulf W
>

--
Alexander Lamb
Founding Associate
RODANOTECH Sàrl

4 ch. de la Tour de Champel
1206 Geneva
Switzerland

Tel:  022 347 77 37
Fax: 022 347 77 38

http://www.rodanotech.ch






More information about the erlang-questions mailing list