Java threadsafe single update

42 Views Asked by At

I have a scenario where threads using single object and in case of a failure, update object once and other getters/threads uses the new updated object.

I am planning to use AtomicReference but not sure if updateAndGet makes sure of achieving this.

I am open to use guave etc too.

Can you provide an example for this ?

0

There are 0 best solutions below