Lots of concurrency

David Chase chase at world.std.com
Sat Oct 20 02:43:19 UTC 2001


Perhaps this is heresy, but it might not hurt to study what
Java has in the way of concurrency support, and perhaps to
compare it with Modula-3.  I do not know Smalltalk well enough
to judge how to translate their idioms into Smalltalk, but
as idioms go, they are good ones.  It is my impression that
Squeak objects are stateful, and that therefore it will be
difficult to talk about things like (for instance) do-parallel
across a collection of objects -- even if you "knew" that the
objects were non-interfering, the shared state at the
implementation level would prevent you from getting much of
a performance boost from this.

I could write much, much more on this, but I do not know enough
about Squeak concurrency to know whether or not I would be making
a redundant fool of myself.

I do know, that if you want lots of concurrency, that you will
probably need to write a threads package that will run on top of
the OS threads (you did want to take advantage of a multiprocessor,
right?) because the OS threads are atrociously fat and slow.
You will need to ensure that the threads have some private implementation
state that can be accessed without locking, else things will go very,
very slowly.  Do not rely on mere instruction counts; if you
see "LOCK CMPXCHG" in Intel machine code, it has the cost of several
dozen instructions.

David Chase





More information about the Squeak-dev mailing list