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

Robin Green greenrd at greenrd.org
Wed Dec 17 08:39:36 EST 2008


This would appear to present a problem for unamb...

Begin forwarded message:

Date: Wed, 17 Dec 2008 13:05:48 +0000
From: Simon Marlow <marlowsd at gmail.com>
To: Gwern Branwen <gwern0 at gmail.com>
Cc: Haskell Cafe <haskell-cafe at haskell.org>
Subject: [Haskell-cafe] Re: Threads not running under GHC 6.10?


Gwern Branwen wrote:
> 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:
>>
>>  http://hackage.haskell.org/trac/ghc/ticket/2783
> 
> 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 at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


More information about the Reactive mailing list