[slime-devel] Long running functions

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. Thanks. -- Elliott Slaughter "Don't worry about what anybody else is going to do. The best way to predict the future is to invent it." - Alan Kay

* Elliott Slaughter [2009-12-07 10:30+0100] writes:
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.
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

On Mon, Dec 7, 2009 at 2:39 AM, Helmut Eller <heller@common-lisp.net> wrote:
When I try 0 as timeout, I get this error: The assertion (OR (NOT SWANK::TIMEOUT) (EQ SWANK::TIMEOUT T)) failed. When I use t as timeout, it does basically what I want, but I'd rather have the timeout be immediate (no wait). Is there any way to do this? Also, it isn't entirely clear what I should pass as a connection to handle-requests. Right now I'm using (or swank::*emacs-connection* (swank::default-connection)) which seems to work fine. Thanks for the help.
-- Elliott Slaughter "Don't worry about what anybody else is going to do. The best way to predict the future is to invent it." - Alan Kay
participants (2)
-
Elliott Slaughter
-
Helmut Eller