Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- println("nprocs=$(nprocs())")
- function x()
- turn = 1
- function work(n)
- for i=1:5
- while (turn != n)
- sleep(1)
- end
- println(n)
- turn = turn % 3 + 1
- end
- end
- @sync begin
- for n=1:3
- @async work(n)
- end
- end
- end
- x()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement