-
Notifications
You must be signed in to change notification settings - Fork 870
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
Back VirtualField with a volatile field #4269
Comments
Are performance gains that come from the field being non-volatile really so significant? Allowing to choose the synchronization model (volatile vs not volatile) when retrieving the field would probably really complicate the already complex |
As with many things, they "can" be very significant. That being said, do we have obvious patterns where non-volatile is OK? I think propagating context is the most common use of virtual field, and this naturally needs to be volatile as it involves multiple threads. Went through a few pages of search results, and I suspect 90+% of usages of
Didn't dig through all usages, but volatile-only seems to be reasonable to me. |
it may be early for us to be tackling volatile fields, but I did find it helpful when pushing performance in glowroot depending on specifics, sometimes the needed visibility memory barriers are provided by writing/reading from an execution queue or object pool (unless i'm wrong, which is entirely possible, this stuff is hard)
👍 |
Tracking issue for discussion item raised in #4262 (comment)
Backing with a volatile field is definitely the safest, but it may also be nice to have the option to back it with a non-volatile field in specific places where we know that's safe.
The text was updated successfully, but these errors were encountered: