Erlang Message passing questions
Tue Jun 2 18:43:16 CEST 2009
I have been reading Joe Armstrong's excellent "Programming Erlang" book
and I have been studing the message passing architecture of Erlang. For
my test application I want to be able to create for example 20,000
processes, each of which are performing an interative function that will
eventually return with a result. The question is this: in Joe's book
the examples given for message passing appear to be polled environments,
where processes are polled periodically for an answer to a message.
Does this present problems from a performance perspective, ie in a high
performance environment would it make more sense to start a collection
of processes, have those processes "do something" and then eventually
return with their result?
I guess the best way of describing the architecture is a star topology
where a single supervisory process dispatches processes, each process
works on a task and then returns with a result at some undetermined
future time. What would the easiest way be to create a batch of
processes (say for example Joe's prime number example on page 357), then
have each of those processes return with an answer message once
Also, based upon the immutability of Erlang how are iterative functions
accomplished such as counter incrementing?
More information about the erlang-questions