Hi Slimers,
I've recently started running slime with clisp on windows. This works great for most things, but now I'm starting to do windows gui programming, and windows wants each program to have it's own event loop, which interferes with slime, which has its own server update loop. Unfortunately, clisp is single threaded, so I can only update windows events or update slime requests at a given time. Is there a function I can call periodically to process slime requests at idle time? Or alternately, can I add a hook to swank so I can pump windows events when slime isn't processing anything?
Many thanks for this great piece of software, and thanks in advance for any help anyone can provide.
cbb
Chris Baker electro@1939worldsfair.com writes:
Hi Slimers,
I've recently started running slime with clisp on windows. This works great for most things, but now I'm starting to do windows gui programming, and windows wants each program to have it's own event loop, which interferes with slime, which has its own server update loop. Unfortunately, clisp is single threaded, so I can only update windows events or update slime requests at a given time. Is there a function I can call periodically to process slime requests at idle time? Or alternately, can I add a hook to swank so I can pump windows events when slime isn't processing anything?
There's little special support for this.
You could call something like
(process-available-input (connection.socket-io *connection*) #'read-from-emacs)
at idle time. process-available-input uses cl:listen to decide whether there is any remaining input. Let's hope that listen does what we want. CLISP's socket:socket-status might also be handy for your purposes.
Note that *connection* must be bound before you call read-from-emacs, so this approach only works if you start SLIME first and your windows event pump runs inside SLIME.
If you need something more complicated have a look at swank:install-fd-handler.
Helmut.
Helmut Eller heller@common-lisp.net writes:
Chris Baker electro@1939worldsfair.com writes:
Hi Slimers,
I've recently started running slime with clisp on windows. This works great for most things, but now I'm starting to do windows gui programming, and windows wants each program to have it's own event loop, which interferes with slime, which has its own server update loop. Unfortunately, clisp is single threaded, so I can only update windows events or update slime requests at a given time. Is there a function I can call periodically to process slime requests at idle time? Or alternately, can I add a hook to swank so I can pump windows events when slime isn't processing anything?
There's little special support for this.
You could call something like
(process-available-input (connection.socket-io *connection*) #'read-from-emacs)
This works great, thanks :)
cbb