You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@curator.apache.org by Jordan Zimmerman <jo...@jordanzimmerman.com> on 2014/07/01 20:21:23 UTC
Re: InterProcessMultiLock documentation
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