[Haskell-cafe] Wait forever in main thread

David Leimbach leimy2k at gmail.com
Mon May 17 14:07:32 EDT 2010


On Mon, May 17, 2010 at 10:04 AM, DPX-Infinity <dpx.infinity at gmail.com>wrote:

> Hi,
> I'm writing a program which listens to some D-Bus signals using
> DBus.Client.onSignal function from dbus-client package. This function
> runs IO action in separate haskell thread when signal is received. My
> program does nothing except signal handling, so after setting up
> signals it has to wait indefinitely. Now I'm using not very clean (I
> think so) forever $ threadDelay 10000000 . Is there another (I mean,
> correct) method to do this thing?
>

You could ask yourself why you need a child thread if the main thread
doesn't do anything else.

I presume you're at a step in the development of something larger and that
you'll eventually have a use for the main thread... otherwise the child
thread is buying you nothing.

Dave


> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100517/77e593b3/attachment.html


More information about the Haskell-Cafe mailing list