links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Using Multiple OS Threads
Last updated at 4:26 am UTC on 23 August 2005
The Squeak Threading Model uses a single OS thread as of April 2005. Maybe it should use more than one? The answer to that question depends on what one is trying to do by having multiple OS threads.

Support for Multiple CPUs

Multiple OS threads provide a way for Squeak to use multiple CPUs simultaneously.

One approach is to use One OS Thread Per Squeak Thread. This approach is simple to implement, but it likely lowers performance tremendously over the current Squeak Threading Model due to the cost of OS-level context switches. A more promissing strategy appears to be using an OS Thread Pool, where there is one OS thread per CPU but Squeak-level thread switches still happen in user space.

Additionally, some people try to use multiple CPU's to exploit Instruction-Level Parallelism.

Cuncurrent Garbage Collection

It may make sense to run a garbage collector in a separate thread from the main interpreter. However, the gain in performance from having an extra CPU can easily be lost by the overhead required to keep the object memory sane even when multiple threads are accessing it simultaneously.

Increase Performance

Some believe that Squeak could have higher performance if it used OS threads. However, there is no specific, compelling proposal as of April 2005.

Preemptive Threads

Preemptive thread scheduling is actually a separate issue. See Alternative Thread Schedulers.

Other Systems that use Multiple OS Threads