less sync-ing with thread registration #5474
... here's an interesting find while trying to upgrade an app stuck on JRuby 1.7.4
the app uses celluloid's actor model and under load degraded considerably (~ 10x).
now, that locking shouldn't be needed since the backing map is already a synchronized collection.
... poked around history and there's no explicit reason for
have patched this on top of of 22.214.171.124 and put under load - the 10x degradation was gone and all seems good, so far. still could use a review whether I did not miss anything.
also how would you guys feel about backporting to 9.1, assuming there's going to be a 126.96.36.199 ?
(thread) context is per-thread and its mostly about setting it up while the local-context field is a thread-local instance
... rest of unregister code is dealing with a thread-local
headius left a comment
These changes look good to me. I don't see a problem with removing the synchronization.
FWIW I did look through history to figure out when these were added, and they go way back to 2005 when I was first reworking JRuby's runtime internal. It looks like it was overcautious then too, since the state changes are similar: d2c051a
also dug around and find old (similar) commits, think from Nick. did hope to find smt explicit where these were introduced for a concrete reason but there seems to be nothing relevant except being cautious.