[slime-devel] single-threaded swank backend and message loops
Jack Unrue
jdunrue at gmail.com
Sun Nov 5 20:27:55 UTC 2006
I'm trying to understand the behavioral difference that I'm seeing between
the sbcl and clisp backends for slime on Windows. First some background. I
have Lisp code that enters a loop to process Windows messages. There is
a get-message function that blocks until the next message is available,
retrieves each such message, and then once that message has
been processed, the loop returns to get-message. Eventually, the application
exits the message loop and control ultimately returns to the repl.
I understand that in single-threaded Lisps like clisp and sbcl/win32, this means
that the slime repl will freeze until my message loop exits, though commands
that I type ahead will be queued (and that's another nice feature of slime).
Now, when I run clisp via slime, this configuration works fine. Messages get
processed just fine while in the loop, and slime works just fine between
runs of my code (i.e., outside of the message loop).
When I run sbcl via slime, not only does the slime repl freeze (which I accept
as expected behavior), but the blocking call to get-message never returns
either. I can use C-c C-c to interrupt sbcl, though.
With some experimental hackery, which I have not yet boiled down to a workable
solution, I can actually get a functional message loop running in the
slime/sbcl case.
This involves bastardizing my code's setup for the loop one time, let
that execute
and so it immediately returns control to slime, and then restore the
correct code.
So there seems to be a possibility of achieving the same behavior as I'm getting
with clisp.
I see that there is a configuration parameter called
swank::*communication-style*
that I can set in my local .swank.lisp. The swank-sbcl.lisp backend code appears
to force the comm style to nil and there is a comment in the
preferred-communication-style function about needing to revisit that once
sbcl/win32 gets better select() support.
I did verify that the comm style is nil when running clisp as well.
Does anyone have any thoughts as to what the difference might be between
the clisp and sbcl backends in this regard, or possible workarounds to
investigate?
Thanks in advance.
--
Jack Unrue
More information about the slime-devel
mailing list