[Haskell-beginners] forkIO and signal handlers

Michael Litchard michael at schmong.org
Fri Sep 9 21:53:27 CEST 2011

Here's the error message. The problem is clear, not sure what to do
about it. My broken code should show my intent though.

> main :: IO ()
> main = do
>     let world = (newEmptyTMVar :: ProcessState)
>     let jCount = (newEmptyTMVar :: JobCount)
>     installHandler userDefinedSignal1 (forkIO $ Catch $ worldHandler world jCount) Nothing
>     sequence_ $ repeat $ worldCheck

I'd like to fork in Main. Right now I'm forking in worldHandler. If
that's what I have to do, then I'll just move on. But I'd like to keep
the forkIO call in Main if possible.

On Fri, Sep 9, 2011 at 12:46 PM, Brandon Allbery <allbery.b at gmail.com> wrote:
> On Fri, Sep 9, 2011 at 15:35, Michael Litchard <michael at schmong.org> wrote:
>> Thanks for the reply. The problem isn't signal handling, nor is it
>> using forkIO. It's using both of them together.
> I think you'll have to provide an example of what you're trying to do and
> the error message you get.
> --
> brandon s allbery                                      allbery.b at gmail.com
> wandering unix systems administrator (available)     (412) 475-9364 vm/sms

More information about the Beginners mailing list