[ ghc-Bugs-1353257 ] Problem with Threading under GHC

SourceForge.net noreply at sourceforge.net
Thu Nov 10 11:12:02 EST 2005


Bugs item #1353257, was opened at 2005-11-10 16:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1353257&group_id=8032

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: GHCi
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Marco Block (schachblocki)
Assigned to: Nobody/Anonymous (nobody)
Summary: Problem with Threading under GHC

Initial Comment:
hi ghc-friends,

i try the following code, but it don't work:

import System.Process
import Control.Concurrent
import System.IO
p = threadDelay 10000000
main3 = do 	putStrLn "test"
		hClose stdin
		(inp, out, err, pid) <- 
runInteractiveProcess "Test.exe" [] Nothing Nothing
		p
		forkIO (putStrLn =<< 
hGetContents out)
  		forkIO (putStrLn =<< 
hGetContents err)
		p
		putStrLn "inp"
 		forkIO (hPutStrLn inp "in" >> 
hClose 
inp)
		p
		forkIO (putStrLn =<< 
hGetContents out)
  		forkIO (putStrLn =<< 
hGetContents err)
		putStrLn "out"
		threadDelay 1000000
		forkIO (hPutStrLn inp "quit" >> 
hClose 
inp)
 		hShow out
		return ()

thanks for helping.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1353257&group_id=8032



More information about the Glasgow-haskell-bugs mailing list