Question

I am using curator library for zookeeper for interprocess lock across machines. There is just one function in which I create the lock, perform the work and then release the lock. Should I use synchronized keyword with this function to ensure that the threads on the same machine call this function serially and hence minimize calls to zookeeper or does it seem to be an overkill?

Was it helpful?

Solution

Curator methods are all re-entrant and thread safe (unless specifically noted). So, no you don't need additional synchronization.

NOTE: I'm the main author of Curator.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top