Skip to content

Instantly share code, notes, and snippets.

@zenna
Created February 21, 2015 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zenna/2d15fba9befb0784c764 to your computer and use it in GitHub Desktop.
Save zenna/2d15fba9befb0784c764 to your computer and use it in GitHub Desktop.
RemoteRef
rr2 = RemoteRef(2)
put!(rr2,"test2")
rr3 = RemoteRef(3)
put!(rr3,"test3")
a = "hello"
function rand2()
return 2*rand(3)
end
g2 = @spawnat 2 print(a); print(take!(rr2))
g2 = @spawnat 2 print(rand2()); print(take!(rr3)) # This causes error
g3 = @spawnat 3 print(take!(rr3))
fetch(g2)
fetch(g3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment