[concurrency-interest] CopyOnWriteArrayNavigableSet review followup

Dr Heinz M. Kabutz heinz at javaspecialists.eu
Wed Dec 30 18:44:54 EST 2015

> 6. Where you use the wrapped COWArrayList for locking, instead of
> synchronized(super.al.lock)
> You may be looking at an old implementation of COWArrayList. In the 
> latest JDK9 repo the type of locking has been changed to a standard 
> Java monitor.
Indeed I was - thank you for that correction.
>> 10. I am concerned by the number of methods that are being called 
>> whilst holding locks.  Whilst I don't have any concrete example, I am 
>> concerned that this could lead to deadlocks.
> We only lock on one private object from our own instance so I don't 
> believe there's any risk of deadlock.
Right, in the version I was looking at you had two - the ReentrantLock 
and the synchronized.  I will still need to check this more carefully, 
considering how long Vector contained a deadlock even with what seemed 
like a single lock :-)

More information about the Concurrency-interest mailing list