In LispWorks 5.1 and previous versions, the main way to synchronize between threads is to use
mp:process-wait
or
mp:process-wait-with-timeout
to supply a predicate to the scheduler. The predicate runs periodically in the background to identify threads that are no longer blocked.
These functions are still available, but there are some alternatives that can be more efficient in many cases by removing the need for the scheduler. The alternatives are:
The new synchronization objects are described in "Synchronization between threads" in the
LispWorks User Guide and Reference Manual
. There are also new "local" variants of
mp:process-wait
which reduce the overhead on the scheduler. See "Process Waiting" in the
LispWorks User Guide and Reference Manual
.
The new function
mp:current-process-pause
is like
cl:sleep
, except that it allows another process to wake up the current process.
The new function
mp:process-join
provides a way to wait until a process dies which returns without any delay after the process dies.
Lastly, there are new synchronization functions which can ensure the order of store and load operations across multiple threads. See "Ensuring order of memory between operations in different threads" in the LispWorks User Guide and Reference Manual .