Multithreading in Squeak
Ned Konz
ned at bike-nomad.com
Thu Mar 8 23:24:16 UTC 2001
On Thursday 08 March 2001 14:36, J Scott Jaderholm wrote:
> I'm curious though, is it only my linux box that is doing this because
> the linux VM doesn't have multithreading for squeak or is it squeak in
> general. If it is linux, how do I fix it? If it is squeak in
> general, who is working on this? One of the biggest things I hear
> complained about emacs is it's lack for multithreading and it would be
> a shame if squeak didn't have that.
Squeak supports multithreading. However, both the MVC and Morphic UI's
operate in a single thread. Unless the programmer of your application
explicitly used multithreading, your UI will wait when you start operations.
Interestingly, all of the Smalltalk part of Squeak runs in a single OS thread.
Bob (I think) added a shared queue into the Morphic UI process, and I added a
similar hook into MVC that allows objects (often blocks or message sends) to
be enqueued for later evaluation in the UI thread.
This is used in parts of the system (look for senders of
addDeferredUIMessage:) that are using multitasking but still want to have
some UI feedback.
I used it to implement auto-updating in the Process Browser, for instance.
You have to be somewhat careful about using it, as it's in the main Morphic
UI loop. If you take too long (like I do in the Process Browser), it'll make
the UI jerky. However, there's also support for alarms and stepping in
Morphic, so a big update task can be spread out over several cycles of time.
--
Ned Konz
currently: Stanwood, WA
email: ned at bike-nomad.com
homepage: http://bike-nomad.com
More information about the Squeak-dev
mailing list
|