On Mon, Apr 26, 2010 at 3:34 PM, Jochen Theodorou <[email protected]> wrote: > I was thinking about changing semantics to say if one thread does a > modification another thread will see it eventually. If the user wants to > ensure it is visible he has to use synchronization by himself. > > My problem is more, that if I want to use non-volatile reads, then all the > reads do have to access immutable data. And this is, what is causing me > headaches.
In JRuby the cached data is immutable; it's a final tuple of a token (for validation) and the target method. Our metaclasses provide and store this tuple when we query them for methods. So the other pieces that do get mutated: * The tuple reference in the call site, which is non-volatile. However, it's ok if it varies from thread to thread for some amount of time since we re-validated it on every call. * The token in each metaclass, also non-volatile. But we have accepted that making class updates across threads will lead to unpredictable results, so it's discouraged and we make no guarantees. - Charlie -- You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en.
