Fw: [Haskell-cafe] Re: Threads not running under GHC 6.10?

This would appear to present a problem for unamb...
Begin forwarded message:
Date: Wed, 17 Dec 2008 13:05:48 +0000
From: Simon Marlow
On Mon, Dec 15, 2008 at 9:00 AM, Simon Marlow wrote:
This particular example illustrates a bug in 6.10.1 that we've since fixed:
OK, that's good...
However in general you can still write expressions that don't allocate anything (e.g. nfib 1000), and your watchdog thread won't get a chance to run unless there's a spare CPU available (+RTS -N2).
Cheers, Simon
But that's bad. What are my options here? Will this threads-not-running issue be fixed in the next release? Since it worked fine in 6.8 as far as I could tell, that makes me think that it must not be anything completely fundamental and unfixable.
I'm afraid the underlying problem is one that GHC has always had - that we can't preempt threads that aren't allocating. It's not easily fixable, we would have to inject dummy heap checks into every non-allocating loop, which would seriously hurt performance for those tight loops. In general you can't rely on being able to kill a thread; however, this only applies to compiled code, interpreted code should always be preemptable, even if it isn't allocating. Cheers, Simon _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (1)
-
Robin Green