[concurrency-interest] StampedLock

Remi Forax forax at univ-mlv.fr
Sun Oct 21 06:04:00 EDT 2012

On 10/21/2012 09:57 AM, Martin Buchholz wrote:
> 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 SequenceReadWriteLock).
> (Or perhaps you've already rejected such names because StampedLock 
> doesn't implement ReadWriteLock?)

BTW, using same argument, the name ReadWriteLock should not have been 
chosen because it's not a Lock.

> 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.


More information about the Concurrency-interest mailing list