CrazyCoder
CrazyCoder

Reputation: 2605

Is update operation on Hazelcast map thread safe?

I am using Hazelcast distributed map in one of my project. Do I need to use Hazelcast lock explicitly when updating a key from multiple nodes or will it be taken care by Hazelcast implicitly, since Hazelcast docs say IMap is thread safe.

Upvotes: 0

Views: 735

Answers (1)

noctarius
noctarius

Reputation: 6104

It will take care of it. Every single key always has just one internal thread mutating it and therefore is implicit thread-safe. However if you have multiple operations like get+mutation+put you'll leave the thread-safety. In this cases an EntryProcessor might help you.

Upvotes: 2

Related Questions