RCU in Java? or some list/set/etc. which can handle concurrent access?
Does Java have some kind of RCU (read-copy-update) mechanism for sets/lists?
What I would like to do is: I have a list of objects that multiple threads can work on. When they're finished, they should remove the object from the list (or the master thread should do it, doesn't matter for now). But also they should fetch a new work-object from that array as well as add new ones.
An option could be add a single lock to the whole list for all read/write access but it is possible that the processingtime of a batch of work-objects is that short that lock-contention would happen constantly. And with enough processors (and thus threads) this lock contention is bound to happen.
So, anyone got a suggestion how to solve this?