[slime-devel] Multi-threaded CCL with SLIME issues

Tobias C. Rittweiler tcr at freebits.de
Fri Jan 9 11:53:37 UTC 2009


Helmut Eller <heller at common-lisp.net> writes:

> * sblist at me.com [2009-01-08 07:25+0100] writes:
>
>>
>> Can anyone offer any advice on how to proceed?
>
> If those things work in SBCL but not in CCL then it probably means that
> CCL implements some thread related features differently.
>
> Global IO redirection only works if *standard-output* etc. are truly
> global variables.  If those variables are thread-local we can't set them
> with a simple setf and would have to use something else, e.g. with a
> backend specific function setf-global.  I don't know how these things
> work in CCL; you could ask the CCL developers how to do it properly.

Looking at the source, CCL does indeed make the *STANDARD-FOO* bindings
thread-local by default. Changing the current implementation of SPAWN
to

  (defimplementation spawn (fn &key name)
    (ccl:process-run-function `(:name ,(or name "Anonymous (Swank)")
                                :use-standard-initial-bindings nil)
                               fn))

will probably solve the issue. I'm not sure how reasonable it would be,
though. Perhaps

 (defimplementation spawn (fn &key name)
   (let ((initial-bindings (set-difference (ccl::standard-initial-bindings)
                                           '((*standard-input*) (*standard-output*))
                                           :key #'car)))
     (ccl:process-run-function `(:name ,(or name "Anonymous (Swank)")
                                 :use-standard-initial-bindings nil
                                 :initial-bindings ,initial-bindings)
                               fn)))

would be more sensible.

  -T.





More information about the slime-devel mailing list