Erlang hints for an OO junkie

Thomas Lindgren thomasl_erlang@REDACTED
Tue Aug 10 10:12:43 CEST 2004


--- Johan Warlander <johan@REDACTED> wrote:
> where would I start running into performance
> problems as far as
> concurrent processes go? 

My rules of thumb (possibly obsolete) are these:
- one Erlang VM (node) can have about 200,000
processes
- one freshly started process uses about 1 KB

Using objects-as-processes and ubiquitous message
passing, a la method invocation in OO, _might_ become
a performance problem. Erlang is asynchronous, so if A
sends a message to B, some effort is needed to context
switch from A to B, and some time may pass before B is
scheduled to handle the message. (Clever
implementations may get rid of some overhead, but it's
probably good to be aware of the issue.)

If you want something OO-like for code organization,
have a look at Erlang's "behaviours". They work in the
same spirit as Java's "interfaces". I would also
suggest taking a look at "abstract data types", if you
haven't already.

Best,
Thomas



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail



More information about the erlang-questions mailing list