xsync
xsync copied to clipboard
Support StampedLock
Introduce a StampedLockFactory
similar to XMutexFactory
, except instead of generating a synchronization monitor, it would generate a StampedLock
instance. This would be useful for applications that could benefit from the performance characteristics of StampedLock
: https://blog.overops.com/java-8-stampedlocks-vs-readwritelocks-and-synchronized/ . It would also be useful for applications that need read-locking vs. write-locking semantics, i.e. allowing multiple concurrent readers provided there are no writers.
Optional: Also introduce a ReadWriteLockFactory
which would be useful for applications that prefer the simpler ReadWriteLock
interface, require re-entrant capabilities, or need to define whether or not the lock is fair.