What is StampedLock in Java?
StampedLock is an alternative to using a ReadWriteLock (implemented by ReentrantReadWriteLock). The main differences between StampedLock and ReentrantReadWriteLock are that: StampedLocks allow optimistic locking for read operations ReentrantLocks are reentrant (StampedLocks are not) So if you have a scenario where you have contention (otherwise you may as well use synchronized or a simple Lock) and … Read more