Alternative Thread Schedulers
Lex Spoon
lex at lexspoon.org
Fri Jun 1 14:54:10 UTC 2007
John M McIntosh <johnmci at smalltalkconsulting.com> writes:
> Right Tim, he would have to add one, need *something* to suspending
> things and fiddling with the list of runnable processes.
Yes, that should be enough. This strategy applies to all kinds of
thread systems, not just Squeak's, and allows you to bootstrap a new
scheduler on top of an existing one.
Some general thoughts about this scheme:
1. Make the scheduler high-priority, so that it reliably gets control
whenever it wants to.
2. Possible make your own "idle" process, one notch above the current
idle process, so that you can detect a lack of activity. This
process can wake up the high-priority one, if you want, by
signalling a semaphore that the high-priority one notices.
3. Consider limiting your schedule to managing a list of threads that
are registered with it, as opposed to literally managing all
threads in the system. This way it plays a little nicer with
anything else that might be running.
Oh, and the obvious:
4. Save often, and make lots of backups. Screwing up thread
scheduling can really ruin an image!
Lex
More information about the Squeak-dev
mailing list
|