Next: , Previous: Inferior-lisp, Up: User-interface conventions


3.1.3 Multithreading

If the Lisp system supports multithreading, SLIME spawns a new thread for each request, e.g., C-x C-e creates a new thread to evaluate the expression. An exception to this rule are requests from the REPL: all commands entered in the REPL buffer are evaluated in a dedicated REPL thread.

Some complications arise with multithreading and special variables. Non-global special bindings are thread-local, e.g., changing the value of a let bound special variable in one thread has no effect on the binding of the variables with the same name in other threads. This makes it sometimes difficult to change the printer or reader behaviour for new threads. The variable swank:*default-worker-thread-bindings* was introduced for such situations: instead of modifying the global value of a variable, add a binding the swank:*default-worker-thread-bindings*. E.g., with the following code, new threads will read floating point values as doubles by default:

     (push '(*read-default-float-format* . double-float)
            swank:*default-worker-thread-bindings*).