haskell-cafe@haskell.org
[Top] [All Lists]

Re: [Haskell-cafe] [help] Program immplementing an alarm

Subject: Re: [Haskell-cafe] [help] Program immplementing an alarm
From: "Yitzchak Gale"
Date: Mon, 28 Apr 2008 17:15:51 +0300
Antonio Regidor García wrote:
>  I'm trying to implement an alarm in Haskell and wrote the following code: 
> http://hpaste.org/7201
>  But it doesn't work as expected.

Hi,

The getLine function ties up stdin. So the system function isn't
able to proceed until getLine completes, even when it is in
another thread.

Try using System.Process.runInteractiveProcess instead of system.
Don't forget to call waitForProcess on the process handle
when you are finished, or you will be left with a zombie.

Hope this helps,
Yitz
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>