Skip to content

Instantly share code, notes, and snippets.

@nahi
Created February 14, 2012 02:03
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 nahi/1822475 to your computer and use it in GitHub Desktop.
Save nahi/1822475 to your computer and use it in GitHub Desktop.
I expected :before, but foo volatility issue comes first
# on Ubuntu with 4 cores
% jruby -v
jruby 1.7.0.dev (ruby-1.9.3-p28) (2012-02-14 78244f2) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_04-ea) [linux-amd64-java]
% while true; do jruby method_invalidate_2.rb; done
:after
:after
:after
:after
:after
:after
:after
:after
:after
:after
:after
:after
:after
:after
# => Never return with CPU 100%
def foo
true
end
def bar
:before
end
t = Thread.new {
true while foo
bar
}
sleep 1
def bar
:after
end
def foo
false
end
p t.join.value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment