[Haskell-cafe] Wait forever in main thread

John Millikin jmillikin at gmail.com
Mon May 17 17:37:03 EDT 2010


Author of dbus-client here. Don Stewart's solution (blocking on an
mvar) is the best way to handle it. Presumably, you've got some way to
make your program shut down (method call? signal handler?) -- just set
the mvar in that.

On Mon, May 17, 2010 at 11:07, David Leimbach <leimy2k at gmail.com> wrote:
> 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

DBus is an asynchronous protocol; running signal handlers in a common
thread would let one long-running computation block receipt of any
others.


More information about the Haskell-Cafe mailing list