next up previous contents index
Next: Token Threading Up: The Dreams System Previous: Repackaging   Contents   Index


Multitasking

So far we have only considered single tasking situations. What happens in a multitasking situation? How do we perform a context switch when the very semantics of the words in the system need to be saved and restored? Since we have saved the old bindings of all altered words on the active bindings stack, we can unbind them back to their original behavior. A concurrent thread of execution must have, in addition to its own parameter and return stacks and instruction pointer, its own copy of each of the stacks in the Dreams implementation.

When a context switch occurs, the context switching mechanism must restore all the bindings pushed onto the old task's active bindings stack, and then rebind all the bindings implicated by all the dream essence pointers pushed on the new task's active essences stack. The first operation removes the understanding of the old task and restores the understanding of reality as a backdrop for the understanding of the new task. This is similar to regressing all the way back to reality. The second operation then recreates the understanding of the new task.

While this approach is semantically sound, and might serve for a user interaction application, it is generally far too slow for any demanding real-time situations. Because the active binding context is distributed all over the place in the various modified parameter field addresses or code field addresses, it is a very difficult thing to quickly save and restore. The slow and laborious process of unbinding each altered behavior of the old task one by one and restoring each altered behavior of the new task one by one seems to be the only way to implement a context switch under these threading schemes.



Subsections
next up previous contents index
Next: Token Threading Up: The Dreams System Previous: Repackaging   Contents   Index
Robert J. Brown
1999-09-26