CLIM mail archive
[Prev][Next][Index][Thread]
Asynchronous Interrupts/Abort
Dear CLIM Community,
working with CLIM 1.1/Allegro v4.1, I've got the problem that I need
something like asynchronous interrupts. Suppose an infinite loop is running
(for example, in the clim listener of the clim demo package) and you want to
interrupt this loop [try a (dotimes (i 1000) (print i)) ].
The abort character in CLIM with Allegro is bound to C-z. Pressing C-z in the
listener window during the evaluation of the statement above has no effect
and is read after dotimes terminates. It seems that CLIM (or CLX/XLIB) pushes
key events (and, for example, resize events which are also evaluated after
execution of the loop) on a queue, which is processed when CLIM comes to a
read-gesture again. Tracing clim:stream-event-handler, it seems that CLIM
isn't informed about these events, so it can't process them (for example, by
immediately signalling clim:abort-gesture and not pushing the event on the
queue).
You could argue that I may interrupt the whole CLIM top-level-loop with a C-c
in the shell the CLIM application was started from. But this is not
acceptable, since after an abort command in a CLIM window I want to return to
the top level loop running in that window, not to return to Lisp. In case of
the CLIM listener, I would expect that C-z returns flow of control back to
the lisp-listener-top-level.
I would expect that CLIM provides a concept for the immediate processing of
abort or break commands. Otherwise, many applications (the simplest of which
is something like a lisp listener) may become useless -- the user has to
kill the whole process if (s)he isn't able to interrupt an infinite loop or
a time-expensive evaluation. Furthermore, when the CLIM application is dumped
in an image and this image is started as a background process on a unix
system, I don't even have a *terminal-io* on which I can enter a C-c.
'kill -9' does the job.
I know that this problem could be solved with multi processing, but this
would destroy the portability of the application (which is the reason why we
use CLIM at the moment). Anyway, aborting the current evaluation without
leaving the application is something which must be possible in any user
interface (when necessary).
Does anyone have similiar problems? Has anyone a 'portable' hack? I *don't*
want to do a stream-peek or a 'listen' during the evaluation.
Oli
PS: Interrupting may work on *Symbolics* machines. Lucky guys. But it doesn't
help me.
0,,
Main Index |
Thread Index