You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The atomicity guarantee for VirtualField.computeIfNull requires a lock, which has led to problems (#4188).
Just dropping the atomicity guarantee is an option, but it could be confusing to have a method that looks like it provides atomicity signature-wise, but really doesn't (#4192 (comment)).
And if it doesn't provide atomicity anyways, usage of computeIfNull can be replaced by calls to get and set.
The text was updated successfully, but these errors were encountered:
I've started working on that and removed almost all usages of computeIfNull - the only one left is ExecutorAdviceHelper#attachContextToTask() - I think it may actually be needed here; it ensures (atomically) that a PropagatedContext is always present, and the PropagatedContext class actually manages the state/context.
I think we can remove the PropagatedContext class together with the computeIfNull method if we simply provide a compareAndSet method on the VirtualField (using an AtomicReferenceFieldUpdater in the generated implementation)
Carrying PR discussion forward from #4262 (comment).
The atomicity guarantee for
VirtualField.computeIfNull
requires a lock, which has led to problems (#4188).Just dropping the atomicity guarantee is an option, but it could be confusing to have a method that looks like it provides atomicity signature-wise, but really doesn't (#4192 (comment)).
And if it doesn't provide atomicity anyways, usage of
computeIfNull
can be replaced by calls toget
andset
.The text was updated successfully, but these errors were encountered: