In the new implementation, processes within Lisp are instances of a CLOS class that can be specialized to get customized behavior. Process objects mediate the programmer's access to threads. The programmer creates an instance of the process class (or of a subclass of the process class) in order to start a parallel computation. The computation's state can be inspected and modified through the use of functions that receive the process object as an argument.
Because processes are CLOS instances, the programmer can create specialized process classes whose instances contain application-specific attributes or behaviors. A server application, for example, could add slots to hold request queues or sockets or transaction-status data structures. After methods defined on initialize-instance and process-terminate could perform application-specific startup and shutdown actions.
This new model allows greatly simplified system design and implementation. It allows the programmer to treat the process and the server instance as a single object, instead of forcing a program structure in which they are two distinct things, one of which owns the other.
In releases prior to 7.0, the implementation on UNIX-style platforms had a process called the scheduler, which controlled all the other processes. (The OS threads implementation on Windows did not have a scheduler, as the Operating System took care of scheduling.) In 7.0, the scheduler process has been discarded. Instead, each process takes care of scheduling duties, particularly when it is started or restarted and when it passes control to another process. This both simplifies the implementation (and makes the OS threads and non-OS threads models more compatible), and improves efficiency by reducing the number of process switches.
The documentation for the multiprocessing has been rewritten. It is available here.
|Copyright © 2018 Franz Inc., All Rights Reserved | Privacy Statement|