5.1 About multitasking
editor, the window system is initialized to contain the main editor window and a Lisp top-level window.
With this model, a call to the function
editor creates the following processes:
mouse-clicked. It also queues characters and runs methods associated with active regions.
bas a single keystroke, the following sequence of events could occur:
1. Before the keystroke is acknowledged, the Multitasking Facility is in an idle state. The Lisp process has indicated to the operating system that it wants to pause, and the scheduler has no processes to run.
2. When the key goes down, the Lisp process runs a very short interrupt handler, which sets a flag called
*window-wakeup*. The setting of this flag causes the window process to wake up and look for an event. It receives the
key-down event and queues that event as input to the editor process. Once the event is queued, the window process blocks and waits for another wake-up request.The scheduler then invokes the editor process because a keystroke is available.
3. The editor process reads the character
b from its input stream and looks it up in a command table. If the top-level buffer is current and if
b is a self-inserting character, the editor process inserts
b into the buffer. It then waits for another character to become available.
4. The scheduler now looks at the Lisp buffer process, which is inside the Common Lisp function
read-char; this process is waiting for a new character to appear at the end of the buffer. Since
b has appeared, the Lisp buffer process is able to run, and the scheduler invokes it. After reading the character, the Lisp buffer process blocks to wait for the next character.
5. Since all processes are now blocked, the scheduler returns to an idle state.
Generated with Harlequin WebMaker