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

SourceForge.net noreply at sourceforge.net
Wed Dec 21 08:55:18 EST 2005


Bugs item #1353257, was opened at 2005-11-10 16:12
Message generated for change (Comment added) made by schachblocki
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.


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

>Comment By: Marco Block (schachblocki)
Date: 2005-12-21 13:55

Message:
Logged In: YES 
user_id=1376599

Sorry ... we working on so many problems and now it's
time for the GHC-Answer :).

Ok, we have one executable program we wants to start and
after the start we give him one parameter which is a string.
The executable file is a chess engine.

Communication is like: 
"e2e4"

then we waiting for response ...
and the engine sais:
"c7c5"

this is our thread. But the code doesn't work. The 
engine was started but not the communication.

thanks alot.

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

Comment By: Simon Marlow (simonmar)
Date: 2005-11-10 16:59

Message:
Logged In: YES 
user_id=48280

Please could you give more information: we don't know what
"Test.exe" is.  What do you expect to happen, and what in
fact does happen?  What behaviour are you claiming is at fault?

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

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