xsync icon indicating copy to clipboard operation
xsync copied to clipboard

Support StampedLock

Open l0s opened this issue 4 years ago • 0 comments

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.

l0s avatar Jun 22 '20 19:06 l0s