【发布时间】:2011-02-28 05:55:26
【问题描述】:
我在 haskell 中有两个线程来执行 IO。 (他们只打印)。类似于以下内容:
thread1 :: IO ()
thread1 = putStrLn "One"
thread2 :: IO ()
thread2 = putStrLn "Two"
我目前得到如下结果:
OnTwoe
OTnweo
如何确保每个线程自动完成其 IO?
【问题讨论】:
标签: multithreading haskell io concurrency