Method and apparatus for dynamic lock granularity escalation and de-escalation in a computer system
First Claim
1. A method for managing access to a computer data resource, the method comprising:
- assigning a plurality of resources to a plurality of hash buckets based on key values associated with said plurality of resources, wherein said step of assigning is performed without respect to any relative order associated with said key values;
receiving a request for a resource in said plurality of resources;
in response to receiving said request, performing the steps of;
generating a hash value based on a key value of said resource;
identifying a hash bucket associated with said hash value;
detecting a granted lock covering any of said plurality of resources in said hash bucket;
modifying a lock scope associated with said granted lock; and
granting a new lock that covers said requested resource.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus for dynamic lock granularity escalation and de-escalation in a computer system is provided. Upon receiving a request for a resource, a scope of a previously granted lock is modified. According to one embodiment, hash lock de-escalation is employed. In hash lock de-escalation, the scope of the previously granted lock held on a set of resources is reduced by de-escalating the previously granted lock from a coarser-grain lock to one or more finer-grain locks on members of the set. According to another embodiment, hash lock escalation is employed. In hash lock escalation, the scope of previously granted locks held on one or more members of the set of resources are released and promoted into a coarser-grain lock that covers the set of resources as well as the requested resource.
113 Citations
33 Claims
-
1. A method for managing access to a computer data resource, the method comprising:
-
assigning a plurality of resources to a plurality of hash buckets based on key values associated with said plurality of resources, wherein said step of assigning is performed without respect to any relative order associated with said key values; receiving a request for a resource in said plurality of resources; in response to receiving said request, performing the steps of; generating a hash value based on a key value of said resource; identifying a hash bucket associated with said hash value; detecting a granted lock covering any of said plurality of resources in said hash bucket; modifying a lock scope associated with said granted lock; and granting a new lock that covers said requested resource. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A method for de-escalation of disjoint sets of computer data resources, comprising the steps of:
-
assigning a plurality of disjoint resources to a plurality of groups; receiving a request for a lock on a resource in said plurality of disjoint resources; and in response to receiving said request, performing the steps of; identifying a group in said plurality of groups that includes said requested resource; detecting a granted lock covering any constituent resource of said group; modifying a lock scope associated with said granted lock; and granting a new lock that covers said requested resource. - View Dependent Claims (9, 10, 11)
-
-
12. A computer system configured to perform the steps of:
-
assigning a plurality of resources to a plurality of hash buckets based on key values associated with said plurality of resources, wherein said step of assigning is performed without respect to any relative order associated with said key values; receiving a request for a resource in said plurality of resources; in response to receiving said request, performing the steps of; generating a hash value based on a key value of said resource; identifying a hash bucket associated with said hash value; detecting a granted lock covering any of said plurality of resources in said hash bucket; modifying a lock scope associated with said granted lock; and granting a new lock that covers said requested resource. - View Dependent Claims (13, 14, 15, 16, 17, 18)
-
-
19. A computer system configured to perform the steps of:
-
assigning a plurality of disjoint resources to a plurality of groups; receiving a request for a lock on a resource in said plurality of disjoint resources; and in response to receiving said request, performing the steps of; identifying a group in said plurality of groups that includes said requested resource; detecting a granted lock covering any constituent resource said group; modifying a lock scope associated with said granted lock when a lock is detected; and granting a new lock that covers said requested resource. - View Dependent Claims (20, 21, 22)
-
-
23. A computer-readable medium having stored therein one or more sequences of instructions for managing access to a data resource, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
-
assigning a plurality of resources to a plurality of hash buckets based on key values associated with said plurality of resources, wherein said step of assigning is performed without respect to any relative order associated with said key values; receiving a request for a resource in said plurality of resources; in response to receiving said request, performing the steps of; generating a hash value based on a key value of said resource; identifying a hash bucket associated with said hash value; detecting a granted lock covering any of said plurality of resources in said hash bucket; modifying a lock scope associated with said granted lock; and granting a new lock that covers said requested resource. - View Dependent Claims (24, 25, 26, 27, 28, 29)
-
-
30. A computer-readable medium having stored therein one or more sequences of instructions for managing access to a data resource, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
-
assigning a plurality of disjoint resources to a plurality of groups; receiving a request for a lock on a resource in said plurality of disjoint resources; and in response to receiving said request, performing the steps of; identifying a group in said plurality of groups that includes said requested resource; detecting a granted lock covering any constituent resource in said group; modifying a lock scope associated with said granted lock; and granting a new lock that covers said requested resource. - View Dependent Claims (31, 32, 33)
-
Specification