[Openmcl-devel] Signal handling
raison at chatsubo.net
Mon Apr 12 11:03:49 PDT 2010
I saw the following message on this list about signal handling in CCL. I
am wondering if either Gary or Leslie could share their strategies for
doing certain things in CCL without being able to define a signal
handler. Specifically, how would you solve the problem of running a
CCL-based web application on any given *nix, where the application needs
to interpret and respond to signals on system shutdown, etc?
Thanks for any input.
-- On Mon Apr 27 11:17:55 EDT 2009, Gary Byers gb at clozure.com wrote:
CCL doesn't offer support for user-defined signal handlers because:
1) there can be lots of tricky issues involved in doing that in
a thread-and-GC-safe way, over and above the usual issues
2) there are almost always simpler ways to do what needs to be done.
The first of these things is certainly true. Whether or not the
second is also true depends on what needs to be done.
IF (a big if) there's really no other way to address some need than to
use a user-defined signal handler, then I suspect that it wouldn't be
adequate to just roll your own with the FFI. Simple cases of that
could work, but the GC complicates things: if the signal is received
while the thread that handles it is running lisp code, you want it to
be able to return to the same (logical) point in that code on signal
return, which can be tricky if the GC runs and moves that code elsewhere.
So far, whenever the issue has come up, I've been able to scare anyone
who believes that they need the ability to define signal handlers out
of that belief. Sooner or later, that may not be possible and it'll
be necessary to provide real support for this (that handles all of the
GC-related issues for you), but my first reaction here is to try to
scare you out of the idea.
On Mon, 27 Apr 2009, Leslie P. Polzer wrote:
> CCL doesn't seem to offer an interface for UNIX/POSIX signals,
> so I need to use the FFI. Is this correct?
> LinkedIn Profile: http://www.linkedin.com/in/polzer
> Xing Profile: https://www.xing.com/profile/LeslieP_Polzer
> Blog: http://blog.viridian-project.de/
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
More information about the Openmcl-devel