So, there is a concurrent hashmap in Java, the advantage of which is not to lock down the whole hash table, but only portions of it. I was wondering whether there was such a construction for arrays. Particularly when an array is being resized locking down the whole array is not desirable, especially in real time applications. Anything out there?
There is AtomicIntegerArray
(and the similar AtomicReferenceArray
) that may fit your description. But as noted by Marcelo - you can't resize arrays. So you only get concurrent safety without the need to explicitly lock (on) the entire array.
An array ... in which elements may be updated atomically
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With