摘要 |
A distributed lock collectively implemented by a plurality of nodes comprises a distributed storage register 1908 having a value determined by a majority of the entities. A protocol is also disclosed for the operation of the lock. The distributed storage register may be a virtual register implemented by a number of nodes running handler routines 1818, 1820, 1822 and 1824, operational routines 1826, 1828, 1830 and 1832, primitives and local variable values. Preferably the local variable values include a storage register value val, 1834 a timestamp associated with the register value val-ts 1836 and a time stamp associated with the most recent write operation ord-ts 1838. The value of the distributed storage register is determined by sending a read message including the local val-ts to the other nodes requesting an indication of whether their local val-ts are equal to the time stamp and whether the time stamp in the message is greater than or equal to their local ord-ts. The lock is then written by obtaining a new timestamp and sending order and write messages to the other nodes. The distributed lock 1908 contains indications of the lock condition and the identity of the locking entity 1804. |