Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:1cbe113d2c79e2fc9d2b
1 2 3 4 5 6 7 8 9 10 11 12 13
import Control.Concurrent.STM
 
test :: Int -> TVar [(Int, Int)] -> IO ()
test 0 t = return ()
test n t = do atomically $ do l <- readTVar t
let l' = (n, n) : l
writeTVar t l'
test (n-1) t
 
 
main = do
tv <- newTVarIO []
test 2000000 tv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.