-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework global variables, caching to eliminate race conditions #4808
Comments
I remember discussing similar stuff mruby with Matz in Rubyconf. |
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. |
See #5525 for another example of problems with this code. It needs to be reworked from the ground up. |
This is largely resolved by #5536 but latest additions there appear to be hanging some suites. I also need to benchmark "bad" cases like heavily-modified globals to ensure we're no worse than the existing logic. Bumped to 9.2.9. |
Moved to 9.4 as part of larger perf work that will happen there. |
This is now happening in #8003. |
This issue spawned from discoveries in #4797, where @eregon discovered that various races in our global variable subsystem seem to be causing us to cache invalid values.
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.
The text was updated successfully, but these errors were encountered: