Multi-threading the interpreter

Patrick Logan patrickl at servio.gemstone.com
Mon Nov 16 18:39:00 UTC 1998


    Gemstone's RC classes might be a good thing to study in this
    regard... 

The RC (Reduced Conflict) collections in Gemstone Smalltalk are *not*
thread safe. They assume a consistent view within a Smalltalk image,
and the Gemstone "image" is not multi-threaded (well, it's not
asynchronously pre-emptive). What is an RC class? Each specific RC
class defines special conditions under which concurrent transactions
to the persistent storage will succeed even though there may be
lower-level "write/write" conflicts. For example, concurrent
transactions adding objects to the same Bag each "write" the Bag, but
should succeed WRT Bag semantics.

    Also java has a bit to offer as well. (and by extension,
    Gemstone/J would be worth looking at)...

Well, Java has the "synchronized" keyword for monitoring access to
shared data. Applications sometimes use other mechanisms such as
mutexes because of the limitations of monitors.

    Also, isn't the whole single-threaded vs multi-threaded issue
    parallel to java's green vs native threads?

Part of the issue is thread-safe methods. A method that is not aware
of other threads may stomp all over the same data as the other thread.

-- 
Patrick Logan                 mailto:patrickl at gemstone.com
Voice 503-533-3365            Fax   503-629-8556
Gemstone Systems, Inc         http://www.gemstone.com





More information about the Squeak-dev mailing list