[concurrency-interest] CopyOnWriteArrayNavigableSet review followup
jini at zeus.net.au
Wed Dec 30 20:27:18 EST 2015
An option might be a single threaded executor, so all writes are uncontended and written by the same thread, then make all access volatile.
Sent from my Samsung device.
Include original message
---- Original message ----
From: Dr Heinz M. Kabutz <heinz at javaspecialists.eu>
Sent: 31/12/2015 09:44:54 am
To: Mike Duigou <openjdk at duigou.org>
Cc: Concurrency Interest <concurrency-interest at cs.oswego.edu>
Subject: Re: [concurrency-interest] CopyOnWriteArrayNavigableSet review followup
> 6. Where you use the wrapped COWArrayList for locking, instead of
> 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 :-)
Concurrency-interest mailing list
Concurrency-interest at cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest