
On Fri, May 4, 2012 at 1:19 PM, Brandon Allbery
On Fri, May 4, 2012 at 1:26 PM, Mike Meyer
wrote: But I realized I never got a more fundamental question answered: when does a signal handler written in Haskell run? Is it like C, in that it runs when the signal arrives, even if I'm currently executing some wrapped C code, and I have to deal with funky rules about what it can do? Or is it like Python, and it will run the first time the Haskell runtime gets control after the signal arrives?
I'm not sure it *does* run. That is, I don't think a Haskell-based signal handler is even possible. When I talk about Haskell's signal handlers, I mean C handlers within the GHC runtime.
Well, there is this: http://www.haskell.org/ghc/docs/latest/html/libraries/unix-2.5.1.0/System-Po... But it's bit short on what exact semantics it provides. It looks like it uses this chunk of code on GHC (on Posix systems): https://github.com/ghc/ghc/blob/376210565e4dff2679246c6ebbcdbb3163c9e8a5/rts... Antoine