Hi, I have function f:: a -> b and I need something like this: myaccept:: Socket -> IO () myaccept g = do a <- accept g t <- forkIO (f a) myaccept g What to do to have two threads working at the same time. When I am using myaccept, program is suspending. Thanks.
Presumably you need a call to yield or threadDelay or something like that. -- Hal Daume III | hdaume@isi.edu "Arrest this man, he talks in maths." | www.isi.edu/~hdaume On Fri, 13 Jun 2003, Filip wrote:
Hi,
I have function f:: a -> b
and I need something like this:
myaccept:: Socket -> IO () myaccept g = do a <- accept g t <- forkIO (f a) myaccept g
What to do to have two threads working at the same time. When I am using myaccept, program is suspending.
Thanks. _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Strange. I have used this form many times without difficulties. Perhaps, it is a platform-dependant bug. Tom On Fri, 13 Jun 2003 03:33 pm, Filip wrote:
Hi,
I have function f:: a -> b
and I need something like this:
myaccept:: Socket -> IO () myaccept g = do a <- accept g t <- forkIO (f a) myaccept g
What to do to have two threads working at the same time. When I am using myaccept, program is suspending.
Thanks. _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
participants (3)
-
Filip -
Hal Daume III -
Thomas L. Bevan