Skip to content
Snippets Groups Projects
Commit c60b5944 authored by Simon Marlow's avatar Simon Marlow
Browse files

make this work non-threaded

parent 9edb1875
No related branches found
No related tags found
No related merge requests found
......@@ -14,9 +14,11 @@ main = do
[s] <- getArgs
let n = read s :: Int
sem <- newQSemN 0
replicateM n (putStr "." >> hFlush stdout >> forkOS (thread sem) >> thread sem)
let fork = if rtsSupportsBoundThreads then forkOS else forkIO
replicateM n (putStr "." >> hFlush stdout >> fork (thread sem) >> thread sem)
waitQSemN sem (n*2)
thread sem = do
var <- newIORef 0
let f = modifyIORef var (1+)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment