why concurrency in the first place?

James Hague jamesh@REDACTED
Mon Feb 5 21:15:53 CET 2001


It sounds like two types of concurrency are being confused.  The one type,
which was promoted by Backus as one of the great benefits of functional
programming, is when the compiler or run-time system determines which
aspects of a program are parallel and handles them as such, presumably
handing each one to a separater processor.  If you don't have side effects,
then this isn't terribly difficult to do.  Maybe not worth it, but still
doable.

In Erlang, though, the concurrency is more like what you see in a
multithreaded OS.  If you want to run an application, you spawn a task.  If
you want to run fifty of the same applications, you spawn fifty tasks.  But
all fifty of those tasks need to interact with common resources at various
points, so you need a way to deal with it.  Most OSes use some form of
resource locking, whereas Erlang uses a message passing scheme.

It is tempting to convince oneself that everything in programming is messy
and should be handled at a higher level, but that's not so easy to do in
practice :)

James



More information about the erlang-questions mailing list