Skip to content

Instantly share code, notes, and snippets.

@dhananjaysathe
Created May 26, 2015 15:38
Show Gist options
  • Save dhananjaysathe/5920e33dfea8ae0de381 to your computer and use it in GitHub Desktop.
Save dhananjaysathe/5920e33dfea8ae0de381 to your computer and use it in GitHub Desktop.
test atomicity of select inside thread
def test val
sleep 0.1
return val%2
end
tp = (1..100).to_a
Thread.new{z= tp.select{|i| (test i )== 0};puts z}
tp=[1,2,3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment