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
I think there’s two very different ways we use synchronized:
To guard in-memory state. For the accesses we acquire the lock, read or write some fields, and release the lock. There’s unlikely to be any > contention for these, and if there is it’s likely to be very short-lived.
To guard I/O. For these accesses we acquire the lock, perform some potentially-slow I/O operation, and release the lock. These ones are > likely to have contention.
I think we definitely want to change 2 to Loom-safe locks. I am unconvinced that there’s a benefit for changing 1. But there is a potential memory + performance cost.
I’d like to find all of the things we converted to ReentrantReadWriteLock to guard in-memory state, and change ’em back to use synchronized.
This is what I wrote in #8290
I’d like to find all of the things we converted to
ReentrantReadWriteLock
to guard in-memory state, and change ’em back to usesynchronized
.This link from @yschimke provides more discussion!
The text was updated successfully, but these errors were encountered: