curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <jor...@jordanzimmerman.com>
Subject Re: InterProcessMultiLock documentation
Date Tue, 01 Jul 2014 18:21:23 GMT
It could be that the doc is out of date. I suggest you use the alternate constructor that takes
a list of InterProcessLock instances. This way, you can allocate whichever locks you want.

-JZ


From: Terry Siu terry.siu@smartfocus.com
Reply: user@curator.apache.org user@curator.apache.org
Date: June 30, 2014 at 10:26:15 AM
To: user@curator.apache.org user@curator.apache.org
Subject:  InterProcessMultiLock documentation  

Hi,

The documentation says the InterProcessMultiLock follows the same usage as “Shared Lock”
which is the InterProcessSemaphoreMutex. Aside from these two classes defining the same APIs,
my assumption was that the multi lock would also use the same non-reentrant lock implementation.
However, after a test and verifying in code, the underlying multi-lock implementation uses
InterProcessMutex. I have a use case where I have a request thread which acquires a lock,
but a callback thread is responsible for releasing it. I was able to achieve this via the
InterProcessSemaphoreMutex and thought I would be able to do the same with InterProcessMultilock
for multiple locks, but the multi-lock requires that the same thread release the lock which
it acquired. Any suggestions on getting around this?

Thanks,
-Terry
Mime
View raw message