[concurrency-interest] Write barrier in ArrayList.grow()
leventov.ru at gmail.com
Wed Sep 12 06:08:26 EDT 2018
Why wouldn't ArrayList add a write barrier in it's grow() method between
the new elementData array population and the assignment of the elementData
field? It would cost almost nothing, but exclude an important class of
races, when one thread adds elements into an ArrayList, and other threads
read elements at small indexes.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest