[Haskell-cafe] Questions on threads and IO

2006-08-16 Thread Creighton Hogg
Hello Haskell'rs, I've been playing with threads and I tried to do a toy example (that used java) from a class. When run, the program should print a prompt and accept commands just like a linux shell. It doesn't have to do anything fancy, just spawn new threads that make system calls when

Re: [Haskell-cafe] Questions on threads and IO

2006-08-16 Thread Chris Kuklewicz
It looks like a stdout buffering issue, plus a 'yield' issue. forkIO does not spawn OS level threads (that is forkOS) so adding a yield helps the runtime: import Control.Concurrent import System import System.IO loop = do putStr z - getLine runCommands z yield