What is `StampedLock` in Java and how does it differ from `ReadWriteLock`?

Java Professional Medium

Java Professional — Medium

What is `StampedLock` in Java and how does it differ from `ReadWriteLock`?

Key points

  • StampedLock has an optimistic read mode for low contention
  • ReadWriteLock does not have an optimistic read mode
  • StampedLock improves throughput by avoiding lock acquisition in certain scenarios

Ready to go further?

Related questions