[gambit-list] Interrupted in wait-for-io
Christian
christian at pflanze.mine.nu
Wed Jan 4 00:36:17 EST 2006
At 10:18 Uhr -0500 03.01.2006, Marc Feeley wrote:
>CTRL-C does not generate an exception. It simply calls the current
>user-interrupt-handler.
Ok, thanks, that makes perfect sense.
Two small followup questions about things I might need in the future:
- can other signals than SIGINT be catched, too? I guess that you
haven't added that since it's platform specific. I might write a
small C layer for my programs on unix, but then my question is: how
do I register an interrupt callback in gambit's runtime (I guess I'll
have to save the signal number and values into some global and then
let gambit run a callback synchronously at a safe point)?
- maybe it's rather theoretical, but there is probably a time frame
between the start of a program and the time when it sets
user-interrupt-handler where sending SIGINT still makes the program
"hang" in the debugger. Could gambit delay installing of a SIGINT
signal handler so that the program behaves in the default way until
the user actually installs a handler?(*) That should also be better
if gambit is to be embedded in a C program which wants to catch
signals itself.
(*) that leads to another question I've been wondering about:
parameterize doesn't accept procedures which aren't parameters (it
checks their type). This makes the above suggestion impossible to be
implement transparently of course, since it would require running
code other than just for setting the dynamic value (**). What's the
reason for this restriction?
((**) without this, the user would have to run some
(user-interrupt-initialize!) hook first -- at least, that might be
better for thread safety?)
Thanks
Christian.
More information about the Gambit-list
mailing list