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

Jeremy Shaw jeremy at n-heptane.com
Tue Dec 16 16:44:30 EST 2008


Hello,

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?

Thanks.

- jeremy



More information about the Haskell-Cafe mailing list