Chittibabu
Chittibabu

Reputation: 1

How to update large objects without blocking other read threads in java

I have a large object that will be accessed by multiple threads continuously. But this object has to be updated periodically and while updating no thread shouldn't be blocked.

I think we can have a Timer to update the object that updates in a duplicate object and once the update is done we can update the object reference with the duplicate object.

Does any one has a better ideas to implement this effectively?

Upvotes: 0

Views: 213

Answers (1)

light_303
light_303

Reputation: 2111

you can implement read/write locks for each property of the object unless you have dependencies between properties.

Upvotes: 1

Related Questions