
Hi all, I'd like to send a signal from the main thread to a forkOS-ed thread in GHC. The former should use raiseSignal and the second should sit in awaitSignal. I figured that the posix functionality in the unix-2.3 library does not cover this case. I would have expected that blocking/sending/receiving signals would utilize the pthread_* routines. This does not seem to be the case. Any idea when these will be available? Thanks in advance, cheers, Gabor PS: I guess some of you will say, "use condition variables". But that won't answer my question :-)

On Wed, Nov 18, 2009 at 2:03 PM, Gabor Greif
PS: I guess some of you will say, "use condition variables". But that won't answer my question :-)
Actually, I was going to say "use throwTo". Is there som reason you have to use the POSIX routines directly instead of using native haskell exceptions? -- Svein Ove Aas

Am 18.11.2009 um 14:15 schrieb Svein Ove Aas:
On Wed, Nov 18, 2009 at 2:03 PM, Gabor Greif
wrote: PS: I guess some of you will say, "use condition variables". But that won't answer my question :-)
Actually, I was going to say "use throwTo".
Is there som reason you have to use the POSIX routines directly instead of using native haskell exceptions?
Because I'd like to eventually send signals from outside (e.g. a shell) too. This is in fact a stripped-down version of a real program written in C mainly to demonstrate how much easier it is to get the same functionality in Haskell. How much work would it be to add the pthread signal blocking/sending facility to the unix library? Cheers, Gabor
-- Svein Ove Aas _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Gabor Greif wrote:
Because I'd like to eventually send signals from outside (e.g. a shell) too. This is in fact a stripped-down version of a real program written in C mainly to demonstrate how much easier it is to get the same functionality in Haskell.
Much easier then to install a signal handler the usual way? This signal handler can in turn use standard asynchronous exceptions to send signals on to the appropriate forkIOed threads... Of course this is a different mechanism, but it feels much more idiomatic vis a vis haskell concurrency and the GHC runtime. --S
participants (3)
-
Gabor Greif
-
sterl
-
Svein Ove Aas