[concurrency-interest] StampedLock

Martin Buchholz martinrb at google.com
Sun Oct 21 03:57:31 EDT 2012

I think a lot of people will want to use StampedLock as a high performance
replacement for code currently using RRWL.  To make this more discoverable,
the "read-write-lock" nature of this lock should be made more obvious.
 E.g. we could name this class StampedReadWriteLock (or even

(Or perhaps you've already rejected such names because StampedLock doesn't
implement ReadWriteLock?)

Perhaps the class javadoc should have more marketing: who would be
interested in this class?

 * A high-performance non-reentrant read-write lock with support for
optimistic reads.

The phrase "capability-based" is misleading (there's no actual security
here) and not especially useful for users (except that they have to learn a
different API from ReadWriteLock).

It's unfortunate that e.g. the writeLock method has different meanings
between RWL and StampedLock.  Can we find better names?  (I'm having
trouble with that myself)

Should StampedLock acquire AbstractOwnableSynchronizer machinery, gaining
safety at the cost of performance?  I don't know.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20121021/9959040a/attachment.html>

More information about the Concurrency-interest mailing list