[slime-devel] Long running functions

Helmut Eller heller at common-lisp.net
Mon Dec 7 10:39:58 UTC 2009


* Elliott Slaughter [2009-12-07 10:30+0100] writes:

> Hi,
>
> I'd like to interact with a running lisp process while it's executing a
> long-running function. Currently, any requests I make during the long running
> function call get pipelined until after the function call ends. As a
> contrived example, execute (sleep 10) at the REPL, then try to compile (C-c
> C-c) a function in another source file while Lisp is busy sleeping.
>
> I've been reading the manual page on swank communication style, and it sounds
> like the :spawn option does what I want. Unfortunately, thread support is not
> universal, and happens to missing on one of my main development platforms
> (SBCL on Windows). Is there any way I can work around this (e.g. add swank
> callbacks to my application)? I know this is kind of a long shot but it would
> be kind of nice to get this working independent of implementation thread
> support.

There's also :sigio which doesn't need threads but probably also not
available on Windows.

Your application could call swank::handle-requests from time to time.
The timeout argument should be 0 to poll the socket without blocking.
:fd-handler style does just that whenever SBCL performs a blocking read.
For this, read-char-no-hang should work for sockets which was broken the
last time I checked. Maybe it's fixed now.

>From Emacs, entering the debgger with C-c C-b should work most of the
time (as usual, may be broken on Windows).  And it should be possible to
use most commands on top of the debugger.

I think ILisp had a option to always send an interrupt before a command.
Not sure how well that would work.

There's also CCL which has a less handicapped Windows port.

Helmut





More information about the slime-devel mailing list