addressing a lot of processes

Chandrashekhar Mullaparthi <>
Fri May 20 18:50:29 CEST 2005


That is right. atoms are not garbage collected. For the number of 
processes you are talking about, you really don't need to worry about 
performance. The lookup table from IP->PID should perform well enough.

The basic rule of programming in erlang is not to worry about 
performance first, but to implement a solution to your problem in the 
most intuitive way. Then you test it and only then think about 
rewriting if your performance requirements are not met.

cheers
Chandru

On 20 May 2005, at 16:23, Gaspar Chilingarov wrote:

> Hello, all!
>
> Can you give an advice, which is more efficient in erlang in following 
> situation:
>
> I have s progmar, which should process information about a lot of IP's 
> (8000-16000).
>
> I've implemented logic associated with each IP in separate process - 
> so,
> for each IP I've to process I spawn separate process.
> For now, I've implemented sample manager, which maps IP(string) to PID
> using gb_trees. In another hand, I've seen sample in some erlang
> sources, to register process under unique name say ip_127.0.0.1,
> ip_127.0.0.2 etc.
>
> This leads to generating the new atoms in runtime, and I'm conscious 
> that erlang's GC will not clean them if they are unused. Am I right?
>
>
> -- 
> Gaspar Chilingarov
> System Administrator
>
> t +37491 419763
> w www.web.am
> e 
>




More information about the erlang-questions mailing list