[Haskell-cafe] Re: excessive usage of CPU by threadDelay in GHCi

Simon Marlow marlowsd at gmail.com
Thu Dec 18 04:57:41 EST 2008


Jeremy Shaw wrote:

> I have the following simple program:
> 
> import Control.Concurrent
> main = threadDelay (10^6) >> main
> 
> If I run it in GHCi it requires 2-5% of my CPU. If i compile it, it
> takes 0% of my CPU. It does not matter if I compile -O0, -O2,
> -threaded, it always uses 0% (which is good).
> 
> Is it expected that threadDelay should be really expensive in GHCi? Am
> I doing something wrong? Or should I file a bug?

Please file a bug.  It could be that the idle time GC is running repeatedly 
rather than just once, or something like that.

Cheers,
	Simon



More information about the Haskell-Cafe mailing list