Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import threadpool, os
- proc testB(x:int) =
- for i in 11..20 :
- #sleep(1)
- echo "Running testB(",x,") i = ",i
- proc testA(x:int) =
- spawn testB(x)
- spawn testB(x+1)
- spawn testB(x+2)
- for i in 1..10 :
- echo "Running testA(",x,") i = ",i
- spawn testA(0)
- spawn testA(10)
- spawn testA(20)
- sync()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement