Writing to the C env ? #7228
Unanswered
JamesKingdon
asked this question in
Q&A
Replies: 2 comments
-
I see there is isUpdateNativeENVEnabled (javadoc.io/doc/org.jruby/jruby-core/1.7.5/org/jruby/RubyInstanceConfig.html#isUpdateNativeENVEnabled()), but I'm not sure what the implications of using it are. |
Beta Was this translation helpful? Give feedback.
0 replies
-
A piece of the puzzle, the modification to the env is done via jruby/core/src/main/java/org/jruby/RubyGlobal.java Lines 681 to 691 in 4c08d1b It attempts to handle concurrency by synchronizing on Object.class, but this only synchronizes Java threads, it doesn't allow for the possibility that non Java threads within a JVM may also be reading from the env. In fact it only seems to synchronize for jruby threads that are writing to the env, Java threads that are reading the env would also be vulnerable to crashing. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
It looks like jruby has support for writing to the C env - is that correct? If so I was wondering how concurrency is handled since the C env is not thread safe for updates.
Beta Was this translation helpful? Give feedback.
All reactions