# US 2004/0019639 A1 · Last thread lock management for multi-threaded process and distributed data systems

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2004/0019639 A1
- Document ID: US20040019639A1
- Status: Published application
- Kind: A1
- Application number: 10/201,844
- Filed: 2002-07-24
- Published: 2004-01-29
- Earliest claimed: 2002-07-24
- Assignees: Sun Microsystems, Inc.
- Inventors: Sandhya E; Ajay Kumar; Hanumantha Rao Susarla
- Web page: https://patentgrep.com/patent/US20040019639A1

## CPC

- G06F 9/526: {Mutual exclusion algorithms}
- H04L 67/02: based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L 67/14: Session management (for real-time applications in data packet communications networks H04L65/1066)
- H04L 67/142: Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
- H04L 69/329: in the application layer [OSI layer 7]
- G06F 2209/522: Manager
- Y10S 707/99938: Concurrency, e.g. lock management in shared database
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- Y10S: TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS

## Abstract

A distributed data system may include nodes hosting at least one multi-threaded process operable to access portions of distributed data. A lock mechanism may grant locks to multi-threaded processes for portions of the distributed data. Only a process holding a lock may access a portion corresponding to the lock. Threads of other processes may not access the portion. A process may include one or more threads that may acquire a locks for the distributed data portion on behalf of the process. In one embodiment, the lock mechanism may allow any thread of a process release a lock held by the process. In embodiments, the last thread to access the distributed data portion corresponding to the lock may release the lock in response to no more threads of the process require access to the distributed data portion and/or in response to a request to release the lock.

## Claims

### Claim 1

A distributed data system comprising:
a plurality of network nodes each configured to execute one or more processes;
a data store configured to store primary data accessible by the processes; and
a lock mechanism coupled to the data store and configured to lock access to portions of the primary data, wherein the lock mechanism is configured to grant a lock to a requester for one of the processes for a primary data portion stored by the data store, wherein the lock mechanism is configured to prevent other processes from accessing the primary data portion while the requester is granted the lock;
wherein each process executing on the plurality of network nodes is configured to have a thread request a lock for the portion of the primary data from the lock mechanism, wherein the process retains the lock while one or more other threads of the process requesting access to the locked portion of primary data access the locked portion of the primary data, and wherein the last thread requesting access the locked portion of primary data releases the lock when no further requests are pending.

### Claim 2 (depends on 1)

The distributed data system as recited in claim 1, wherein each of the processes is configured so that when the thread of the process that requested the lock acquires the lock, the one or more other threads of the process requesting access to the portion of the primary data access the portion of the primary data while the process retains the lock.

### Claim 3 (depends on 2)

The distributed data system as recited in claim 2, wherein each of the processes is configured to:
increment a count corresponding to the lock for the portion of the primary data in response to a thread of the process requesting access to the portion of the primary data;
decrement the count in response to a thread completing access to the locked portion of the primary data; and
wherein the last thread is configured to release the lock in response to the count reaching an initial value.

### Claim 4 (depends on 1)

The distributed data system as recited in claim 1, wherein each of the processes is configured to initiate a dummy requester upon acquiring the lock to indicate a pending request for access to the portion of the primary data, wherein the process is configured to cancel the dummy requester only in response to receiving a request to release the lock so that the process holds the lock until the process receives a request to release the lock.

### Claim 5 (depends on 1)

The distributed data system as recited in claim 1, wherein the plurality of network nodes comprise one or more application servers of a multi-tiered enterprise system.

### Claim 6 (depends on 1)

The distributed data system as recited in claim 1, wherein the one of the processes comprises a Java virtual machine.

### Claim 7 (depends on 1)

The distributed data system as recited in claim 1, wherein a portion of the primary data stored by the data store represents state information of a client-server session.

### Claim 8 (depends on 1)

The distributed data system as recited in claim 1, wherein if a requester for a process holds a lock for a portion of the primary data, the lock mechanism is configured to buffer one or more requests for the lock for that portion of the primary from one or more other requesters for one or more other processes.

### Claim 9 (depends on 9)

The distributed data system as recited in claim 9, wherein in response to the process releasing the lock for the portion of the primary data, the lock mechanism is configured to grant the lock for that portion of the primary data to a next buffered requester for that primary data portion.

### Claim 10

A computing system comprising:
a processor;
memory comprising program instructions executable by the processor to implement:
a process configured to access portions of distributed data stored within a distributed data store accessible to other processes;
wherein the process is configured to have a thread request a lock for a portion of the distributed data from a lock mechanism of the distributed data store, wherein the process retains the lock while one or more other threads of the process requesting access to the locked portion of distributed data access the locked portion of the distributed data, and wherein the last thread requesting access the locked portion of distributed data releases the lock when no further requests are pending.

### Claim 11 (depends on 10)

The computing system as recited in claim 10, wherein the process is configured so that when the thread that requested the lock obtains the lock for the portion of the distributed data the one or more other threads access the portion of the distributed data while the process retains the lock.

### Claim 12 (depends on 11)

The computing system as recited in claim 11, wherein the process is configured to:
increment a count corresponding to the lock for the portion of the distributed data in response to a thread of the process requesting access to the portion of the distributed data;
decrement the count in response to a thread of the process completing access to the locked portion of the distributed data; and
wherein the last thread is configured to release the lock in response to the count reaching an initial value.

### Claim 13 (depends on 10)

The computing system as recited in claim 10, wherein the process is configured to initiate a dummy requester upon acquiring the lock to indicate a pending request for access to the portion of the distributed data, wherein the process is configured to cancel the dummy requester only in response to receiving a request to release the lock so that the process holds the lock until the process receives a request to release the lock.

### Claim 14 (depends on 10)

The computing system as recited in claim 10, wherein the memory comprises program instructions executable by the processor to implement an application server for a multi-tiered enterprise system, wherein the process is configured to execute within the application server.

### Claim 15 (depends on 10)

The computing system as recited in claim 10, wherein the process comprises a Java virtual machine.

### Claim 16 (depends on 10)

The computing system as recited in claim 10, wherein a portion of the distributed data represents state information of a client-server session.

### Claim 17

A method comprising:
a thread of a process acquiring a lock for a portion of distributed data of a distributed data store from a lock mechanism of the distributed data store;
one or more other threads of the process requesting access to the locked portion of the distributed data while the process retains the lock; and
a last thread to request access to the portion of the distributed data releasing the lock when no further requests are pending.

### Claim 18 (depends on 17)

The method as recited in claim 17, further comprising the one or more other threads of the process accessing the portion of the distributed data while the process retains the lock.

### Claim 19 (depends on 18)

The method as recited in claim 18, further comprising:
incrementing a count corresponding to the portion of the distributed data for each thread of the process requesting access to the portion of the distributed data;
decrementing the count corresponding to the locked portion of the distributed data for each thread of the process completing access to the locked portion of the distributed data; and
the last thread releasing the lock for the process in response to the count reaching an initial value.

### Claim 20 (depends on 17)

The method as recited in claim 17, further comprising:
the process initiating a dummy requester upon acquiring the lock to indicate a pending request for access to the portion of the distributed data; and
if the process is requested to release the lock, the process canceling the dummy requester so that the process holds the lock until the process receives a request to release the lock.

### Claim 21 (depends on 17)

The method as recited in claim 17, further comprising another thread of the process releasing of the lock for the process when further requests are pending.

### Claim 22

An article of manufacture comprising program instructions executable to implement:
a thread of a process acquiring a lock for a portion of distributed data of a distributed data store from a lock mechanism of the distributed data store;
one or more other threads of the process requesting access to the locked portion of the distributed data while the process retains the lock; and
a last thread to request access to the portion of the distributed data releasing the lock when no further requests are pending.

### Claim 23 (depends on 22)

The article of manufacture as recited in claim 22, wherein the program instructions are further executable to implement the one or more other threads of the process accessing the portion of the distributed data while the process retains the lock.

### Claim 24 (depends on 23)

The article of manufacture as recited in claim 23, wherein the program instructions are further executable to implement:
incrementing a count corresponding to the portion of the distributed data for each thread of the process requesting access to the portion of the distributed data;
decrementing the count corresponding to the locked portion of the distributed data for each thread of the process completing access to the locked portion of the distributed data; and
the last thread releasing the lock for the process in response to the count reaching an initial value.

### Claim 25 (depends on 22)

The article of manufacture as recited in claim 22, wherein the program instructions are further executable to implement:
the process initiating a dummy requester upon acquiring the lock to indicate a pending request for access to the portion of the distributed data; and
if the process is requested to release the lock, the process canceling the dummy requester so that the process holds the lock until the process receives a request to release the lock.

### Claim 26 (depends on 22)

The article of manufacture as recited in claim 22, wherein the program instructions are further executable to implement another thread of the process releasing of the lock for the process when further requests are pending.
