RFR [8005953] Speedup construction of CopyOnWriteArraySet in special cases

Doug Lea dl at cs.oswego.edu
Mon May 6 16:16:05 UTC 2013


On 04/30/13 07:41, Ivan Gerasimov wrote:
> Hello everybody!
>
> Would you please review my proposal to change constructor of CopyOnWriteArraySet?


I included something with similar effect in CopyOnWriteArray{List,Set}
update in jsr166 repo: It bypasses copy in CopyOnWriteArrayList
constructor (and, when empty, addAll) when argument is another
CopyOnWriteArrayList. The CopyOnWriteArraySet constructor relays
to it when possible.

As Jason noted, this is a conservatively compatible change.
It doesn't apply to non-CopyOnWriteArray{List,Set} arguments.

We can integrate this into openjdk at next sync-up.
http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/CopyOnWriteArrayList.java?view=log
http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/CopyOnWriteArraySet.java?view=log

-Doug




More information about the core-libs-dev mailing list