--- Phil Ehrens <pehrens / nospam.ligo.caltech.edu> wrote:
> Event loops are better than threads.  John Ousterhout
> may not have been a very good businessman, but he's
> a brilliant computer scientist:

Oddly enough, having read partway through this, I don't
really disagree,  despite having a "every programmer a
threads programmer" attitude.  The event-driven paradigm
that Ousterhout advances here is similar to the ultimate
goal of much of the thread programming I do.  What this
presentation fails to take into account however, is that
for many applications, the programmer does not have the
luxury of an API that allows  her to register all the
events in which she is interested.  In creating an elegant,
event-driven multithreaded application, the programmer
usually has to first set up an infrastruture that exposes
various system states as events.  Only then can handlers be
registered for those events.

What Ousterhout says about thread programming being
difficult is (unfortunately) quite true.  Thread
programming doesn't have to be that hard though.  The
problem here is that, despite how long threads have been
with us, much of the thread programming that is taught and
practiced is still at an unnecessarily low level. 
Multithreaded programs are still intricate masses of
heavily interdependant threads and complex locking schemes.
 The design patterns, idioms, and paradigms that can
greatly simplify thread programming have barely begun to
propagate into the various language communities.

I was pleasently surprised when I found that
implementations of certain basic muiltithreading patterns
were included in the Ruby standard library.  This is more
than can be said for many languages.  But it's still not
nearly enough.  If more languages provided standard,
out-of-box implementations of things like synchronized
objects, the Reactor pattern, and the Active Object
pattern, multithreaded programming probably wouldn't be
nearly the "black art" that it's currently regarded as.

- Avdi Grimm

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/