Re: [javagroups-users] DistributedLockManager
Brought to you by:
belaban
From: Bela B. <be...@ya...> - 2002-09-11 13:34:11
|
Hi Eric, eb...@me... wrote: > Thank you. I don't find the file DistributedLockManagerTest in the latest > distribution or in CVS. It is in JG_ROOT/tests/junit/org/javagroups/blocks > I don't understand the meaning of timeout in the method lock. Is it > the time > the method waits to acquire the lock ? When I look (very quickly) to the > code, it seems that it is just used for the > RpcDispatcher.callRemoteMethods. Yes, it is the max time we wait to receive all results. If not all results have been received by then, the lock acquisition process is considered to have failed. 0 means wait forever. > During the execution of my code, when a member has a lock and if another > tries to acquire it, instead of waiting the amount of time (defined by > timeout), the lock method throws immediately LockNotGrantedException. That's what it is supposed to do: the member mcasts a GET-LOCK request to all members (including itself). One member votes NO because its lock is taken, and as soon as we have the first NO, the lock acquisition protocol throws the LockNotGrantedException. Thus the timeout is *not* used to wait for a locked lock to become available, just to wait for all responses. -- Bela Ban www.javagroups.com (408) 316-4459 |