1

Internally entry processor also perform the lock and unlock on the key as pessimistic locking. But entry processor is more efficient as compared to pessimistic locking. Whats the difference between these to?

Hiten
  • 53
  • 9

1 Answers1

3

Answer copy from the mailinglist:

An EntryProcessor doesn’t perform a lock. It is not necessary since EntryProcessors running in the same partition threads as all other operations, therefore you have an implicit locking like behavior. That is btw the reason why EntryProcessors shouldn’t be long running operations!

noctarius
  • 5,979
  • 19
  • 20
  • So can we use Entry processor in place of explicit locking for updating a shared variable in multi threaded environment if its not an long running operations? – Hiten Mar 22 '15 at 18:11
  • Depends on what you expect that shared variable to be. If it is a Hazelcast data structure, yes. – noctarius Mar 22 '15 at 19:02
  • Yes, i am planning to use Hazelcast data structure concurrent map. – Hiten Mar 23 '15 at 03:24