[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Processes in Smalltalk-80


You're correct that the VM process scheduler in the Smalltalk-80 system
doesn't do time-slicing.  There are two reasons for this.  The more
important one is that it isn't necessary!  You can easily do time-slicing
entirely in Smalltalk.  Just install a high-priority process that
repeatedly waits on a short timer, and then shuffles the lower-priority
process queues when it wakes up.  This was actually done as a summer
student project at Xerox PARC several years back.  If the time slice is
reasonably long compared to the time required for the process switching and
manipulations (say, 10 ms on a SPARC), the overhead won't be significant.
The advantage of this approach, of course, is that you don't wind up with
unchangeable policies wired into the VM.

The other reason is that the Smalltalk-80 *system* code is not designed to
be time-sliced.  If we really wanted people to write general concurrent
programs, we would have to program the way the DEC folks do in Modula-2+:
all interesting data structures would have to be monitor-locked, etc.  I
don't think you'll find the situation any better in Self in this respect.