Systems and methods for managing concurrent access requests to a shared resource
First Claim
Patent Images
1. A method of managing concurrent access requests to a data segment, comprising:
- tracking shared lock requests from a plurality of processes in a first data structure when no exclusive waiter is present, wherein the first data structure tracks the total number of shared locks;
tracking shared lock requests in a second data structure when an exclusive waiter is present and the total number of shared locks is greater than zero, wherein the second data structure tracks the number of shared locks held by each of the plurality of processes;
tracking recursive shared lock requests in the second data structure when an exclusive waiter is present and the total number of shared locks is zero;
granting an exclusive lock to the exclusive waiter when the total number of shared locks is zero and the number of shared locks held by each of the plurality of processes is zero.
14 Assignments
0 Petitions
Accused Products
Abstract
The systems and methods manage concurrent access requests to a shared resource. The systems and methods utilize an access management algorithm that permits multiple processes to concurrently obtain shared locks on the shared resource, but also limits access to only one process when an exclusive lock is granted. In doing so, the systems and methods avoid the problems of starvation and deadlock.
-
Citations
17 Claims
-
1. A method of managing concurrent access requests to a data segment, comprising:
-
tracking shared lock requests from a plurality of processes in a first data structure when no exclusive waiter is present, wherein the first data structure tracks the total number of shared locks;
tracking shared lock requests in a second data structure when an exclusive waiter is present and the total number of shared locks is greater than zero, wherein the second data structure tracks the number of shared locks held by each of the plurality of processes;
tracking recursive shared lock requests in the second data structure when an exclusive waiter is present and the total number of shared locks is zero;
granting an exclusive lock to the exclusive waiter when the total number of shared locks is zero and the number of shared locks held by each of the plurality of processes is zero.
-
-
2. A method of managing concurrent access requests to a shared resource, comprising:
-
receiving a first plurality of shared requests;
granting the first plurality of shared requests;
tracking completion of the first plurality of shared requests;
receiving an exclusive request;
receiving a second plurality of shared requests before the first plurality of shared requests has been completed;
granting the second plurality of shared requests;
tracking completion of the second plurality of shared requests on a per-process basis;
receiving a third plurality of shared requests after the first plurality of shared requests has been completed;
determining whether each of the third plurality of shared requests is a recursive request;
for each of the recursive requests, granting the recursive request; and
tracking completion of the recursive request on a per-process basis; and
after completion of the third plurality of shared requests and the recursive requests, granting the exclusive request
-
-
3. A method of managing concurrent access requests to a shared resource, wherein a first at least one process has a shared lock on the shared resource, comprising:
-
storing a representation of the number of a second at least one processes waiting to obtain an exclusive lock on the shared resource in an exclusive waiting count, wherein the exclusive waiting count is a first data structure and the second at least one processes waiting to obtain an exclusive lock on the shared resource are put to sleep;
storing a representation of the number of first at least one processes that have a shared lock on the shared resource in a global count if the exclusive waiting count indicates that none of the second at least one processes are waiting to obtain an exclusive lock on the shared resource, wherein the global count is a second data structure;
adjusting a per-process count when one of the first at least one processes obtains a shared lock on the shared resource if the exclusive waiting count indicates that at least one of the second at least one processes is waiting to obtain an exclusive lock on the shared resource, wherein the per-process count is a third data structure that stores a representation of the number of shared locks held by each of the first at least one processes;
adjusting the per-process count when one of the first at least one processes terminates a shared lock on the shared resource if the exclusive waiting count indicates that at least one of the second at least one processes is waiting to obtain an exclusive lock on the shared resource and the global count indicates that at least one of the first at least one processes holds a shared lock on the shared resource and the per-process count indicates that the one of the first at least one processes does not hold a shared lock on the shared resource;
adjusting the global count when at least one of the first at least one processes terminates a shared lock on the shared resource if the exclusive waiting count indicates that at least one of the second at least one processes is waiting to obtain an exclusive lock on the shared resource and the global count indicates that at least one of the first at least one processes holds a shared lock on the shared resource and the per-process count indicates that none of the first at least one processes holds a shared lock on the shared resource; and
granting all shared lock requests from the first at least one processes if the global count indicates that at least one of the first at least one processes holds a shared lock on the shared resource. - View Dependent Claims (4, 5, 6, 7, 8)
-
-
9. An access management system for managing concurrent access requests to a shared resource comprising:
-
a shared resource;
a processor module, wherein a first at least one process has a shared lock on the shared resource, configured to;
receive requests from the first at least one processes for a shared lock on the shared resource;
receive requests from a second at least one process for an exclusive lock on the shared resource;
store a representation of the number of a second at least one processes waiting to obtain an exclusive lock on the shared resource in an exclusive waiting count, wherein the exclusive waiting count is a first data structure and the second at least one processes waiting to obtain an exclusive lock on the shared resource are put to sleep;
store a representation of the number of the first at least one processes that have a shared lock on the shared resource in a global count if the exclusive waiting count indicates that none of the second at least one processes are waiting to obtain an exclusive lock on the share resource, wherein the global count is a second data structure;
adjust a per-process count when one of the first at least one processes obtains a shared lock on the shared resource if the exclusive waiting count indicates that at least one of the second at least on processes is waiting to obtain an exclusive lock on the shared resource, wherein the per-process count is a third data structure that stores a representation of the number of shared locks held by each of the first at least one processes;
adjust the per-process count when one of the first at least one processes terminates a shared lock on the shared resource if the exclusive waiting count indicates that at least one of the second at least one processes is waiting to obtain an exclusive lock on the shared resource and the global count indicates that at least one of the first at least one processes holds a shared lock on the shared resource and the per-process count indicates that one of the first at least one processes holds a shared lock on the shared resource;
adjust the global count when one of the first at least one processes terminates a shared lock on the shared resource if the exclusive waiting count indicates that at least one of the second at least one processes is waiting to obtain an exclusive lock on the shared resource and the global count indicates that at least one of the first at least processes holds a shared lock on the shared resource and the per-process count indicates that the one of the first at least one processes does not hold a shared lock on the shared resource; and
grant all shared lock requests from the first at least one processes if the global count indicates that at least one of the first at least one processes holds a shared lock on the shared resource. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16, 17)
-
Specification