
* Madhu [2008-10-30 18:48+0100] writes:
It used to be possible to run multiprocessing servers like a webserver which coexisted with slime. This is no longer possible With current CVS slime, swank's WAIT-FOR-EVENT blocks all other processes from handling FD events
SLIME's WAIT-FOR-STREAMS calls SYS:SERVE-EVENT with a timeout of 0.2 seconds. That's shorter than LISP::*MAX-EVENT-TO-SEC*--which is 1 second--and consequently the LISP::*PERIODIC-POLLING-FUNCTION* isn't called.
There is a simple test case, but here is a more realistic one: I'm attaching a program "t2.lisp" which seeks to illustrates the problem. This is a simple program which listens on a port [8128 by default] and prints a message to clients which connect to it.
-- In a bare lisp
* (load "t2.lisp")
LISTEN-FOR-CONNECTIONS creates a process which listens at port 8128.
-- run `telnet localhost 8128' from a shell, a few times.
This will result in the bogus service printing a message to the telnet client, as expected.
-- load slime in the lisp, and listen at port 4005
* (load "/path/to/swank-loader.lisp") * (swank-loader::init) * (swank::setup-server 4005 #'print nil nil (swank::find-external-format "latin-1-unix"))
nil as *communication-style* is not the default.
-- Connect to the lisp from emacs using M-x slime-connect localhost 4005
-- run `telnet localhost 8128' from a shell.
This hangs until the slime connection exits.
It doesn't hang in the default configuration. More precisely, it doesn't hang if I run SLIME with (eq *communication-style* :sigio). It hangs, with the default config, if the SLIME debugger is active. It doesn't hang, even with active debugger, if (eq *communication-style* :spawn). It doesn't hang, even with active debugger, if *max-event-to-sec* is 0 and *max-event-to-usec* is 1000. It doesn't hang, even with active debugger, with (eq *communication-style* :sigio) if multiprocessing is initialized properly and the idle process runs. E.g. if you start the swank server with: (swank::initialize-multiprocessing (lambda () (swank:create-server)))
This is a serious problem, and exposes many issues with SLIME's design.
Which issues? Helmut.