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
Rework global variables, caching to eliminate race conditions #4808
There are numerous races, including but not limited to:
There are likely others. The main problems lie in the fact that this part of JRuby is some of the oldest code, many files only bearing the copyright of the first committer to JRuby. None of this code was built for concurrency, and the many levels of abstraction and mutation make a simple fix impossible.
This bug will track a rework of the global variable subsystem for JRuby 9.2, which will eliminate some of the unnecessary abstraction, use appropriate thread-safe structures and synchronization for modification, and properly enable safe caching of values.
We did various amounts of work to improve globals during the 9.1 cycle, but I have not evaluated how well the current implementation deals with globals. The plumbing is still a bit messy and I'm sure there are remaining races, plus we have never really reenabled global optimization in indy the way I'd like.
Bumping to post 9.2 for additional work.