blob: edfab5ca62db9d3f67945f5993b58ac57da6b23a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import Control.Concurrent
import Control.Monad
import GHC.Conc
main = do
mainTid <- myThreadId
labelThread mainTid "main"
forM_ [0..0] $ \i -> forkIO $ do
subTid <- myThreadId
labelThread subTid $ "sub " ++ show i
forM_ [0..100000000] $ \j -> putStrLn $ "sub " ++ show i ++ ": " ++ show j
yield
setNumCapabilities 2
|