Advantages of a large number of threads cf other approaches?

jonathan <>
Tue Feb 17 01:19:14 CET 2004


On 16 Feb 2004 at 13:23, Jay Nelson wrote:

> There was a discussion of processes last year.  I tried to
> catalog a variety of uses for them.  See
> http://www.erlang.org/ml-archive/erlang-questions/200303/msg00441.html

That's excellent. I'll go there now. 


>  > It's so easy to have all your
>  > objects inherit from a Smalltalk/C++ base class with an update
>  > method and loop through all of them.
> 
> This works fine if they are all in lock-step.  If some are
> expected to react  more quickly than others, you have
> to modify the loop.  In the general case, your loop encodes
> priority and other semantics that are more rightfully imposed
> by the simulated objects rather than the simulation environment.

I think most OO people would move this code out of the loop and 
either into the objects or a set of handles/iterators.
 
> If you want truly independent behavior and don't want to write an
> asynchronous handler 

Yes, the more the sim tends to be asynchronus the better off you are 
with threads. 

- Jonathan Coupe





More information about the erlang-questions mailing list