Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Global variables read stale values #4797
Global variable reads should behave as if they are volatile, so they always get the latest value.
However, it seems the invokedynamic implementation is not thread-safe or make some of the reads just get stale values, and never see the new value.
See bug_jruby_globals.rb to reproduce.
It accepts a number of threads as an argument.
There seems to be other thread safety issues in the implementation of globals: