[Haskell-cafe] system in forkIO

Jules Bean jules at jellybean.co.uk
Sun Sep 14 15:10:09 EDT 2008

Andrea Rossato wrote:
> On Sun, Sep 14, 2008 at 02:24:23PM -0300, Marco Túlio Gontijo e Silva wrote:
>> and the result of ls only after I press a key.  Does getChar blocks the
>> other threads?
> yes, but you can use forkOS from Control.Concurrent and compile with
> -threaded.
> See the relevant documentation for the details.

forkOS not relevant here.

-threaded is necessary to allow haskell code to run whilst FFI calls are 
blocked. getChar doesn't count as an FFI call (the RTS does its own IO 
multiplexing) but system does.

forkOS is to do with bound threads, that's something else.


More information about the Haskell-Cafe mailing list