[Haskell-cafe] Why does sleep not work?

Manlio Perillo manlio_perillo at libero.it
Tue Feb 10 19:04:01 EST 2009


Corey O'Connor ha scritto:
> 2009/2/10 George Pollard <porges at porg.es>:
>>> import System.Posix
>>>
>>> main = do
>>>       putStrLn "Waiting for 5 seconds."
>>>       blockSignals $ addSignal sigVTALRM emptySignalSet
>>>       sleep 5
>>>       putStrLn "Done."
>>>
> 
> Huh! Does the GHC runtime uses this signal? Perhaps for scheduling?
> 

Right.
It is used for scheduling, as far as I understand.
So blocking it is a bad idea (unless you block it in a thread other than 
the main thread, IMO).

> Cheers,
> -Corey O'Connor
> 


Regards  Manlio


More information about the Haskell-Cafe mailing list