make-thread function &key name initial-bindings trap-conditions => thread
Arguments and values:
function -> a function
name -> a string or nil.
initial-bindings -> an alist mapping special variable names to values. Defaults to *default-special-bindings*.
trap-conditions -> if true, wrap the thread function in a handler-case.
Creates and returns a thread named
name, which will call the
function with no arguments: when
function returns, the
The interaction between threads and dynamic variables is in some cases complex, and depends on whether the variable has only a global binding (as established by e.g. defvar/defparameter/top-level setq) or has been bound locally (e.g. with let or let*) in the calling thread.
Global bindings are shared between threads: the initial value of a global variable in the new thread will be the same as in the parent, and an assignment to such a variable in any thread will be visible to all threads in which the global binding is visible.
Local bindings, such as the ones introduced by
initial-bindings, are local to the thread they are introduced in, except that
Local bindings in the the caller of make-thread may or may not be shared with the new thread that it creates: this is implementation-defined. Portable code should not depend on particular behaviour in this case, nor should it assign to such variables without first rebinding them in the new thread.
The threading model is implementation-dependent.