Mechanism for managing resource locking in a multi-threaded environment
First Claim
1. A method implemented by a lock manager in a multi-threaded environment, comprising:
- receiving, from a particular stream executing a particular thread, a request to obtain a lock on a resource;
determining whether the resource is currently locked by another stream; and
in response to a determination that the resource is currently locked by another stream, adding the particular stream to a wait list of streams waiting to obtain a lock on the resource.
2 Assignments
0 Petitions
Accused Products
Abstract
A mechanism is disclosed for implementing resource locking in a massively multi-threaded environment. The mechanism receives from a stream a request to obtain a lock on a resource. In response, the mechanism determines whether the resource is currently locked. If so, the mechanism adds the stream to a wait list. At some point, based upon the wait list, the mechanism determines that it is the stream'"'"'s turn to lock the resource; thus, the mechanism grants the stream a lock. In this manner, the mechanism enables the stream to reserve and to obtain a lock on the resource. By implementing locking in this way, a stream is able to submit only one lock request. When it is its turn to obtain a lock, the stream is granted that lock. This lock reservation methodology makes it possible to implement resource locking efficiently in a massively multi-threaded environment.
142 Citations
80 Claims
-
1. A method implemented by a lock manager in a multi-threaded environment, comprising:
-
receiving, from a particular stream executing a particular thread, a request to obtain a lock on a resource;
determining whether the resource is currently locked by another stream; and
in response to a determination that the resource is currently locked by another stream, adding the particular stream to a wait list of streams waiting to obtain a lock on the resource. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)
-
-
18. A lock manager, comprising:
-
means for receiving, from a particular stream executing a particular thread, a request to obtain a lock on a resource;
means for determining whether the resource is currently locked by another stream; and
means for adding, in response to a determination that the resource is currently locked by another stream, the particular stream to a wait list of streams waiting to obtain a lock on the resource. - View Dependent Claims (19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34)
-
-
35. A machine implemented method, comprising:
-
receiving, from a first stream executing a first thread, a request to obtain a lock on a resource;
granting the first stream a lock on the resource;
receiving, from a second stream executing a second thread, a request to obtain a lock on the resource;
determining that the resource is currently locked; and
in response to a determination that the resource is currently locked, adding the second stream to a wait list of streams waiting to obtain a lock on the resource, wherein the wait list indicates that the second stream follows the first stream in obtaining a lock on the resource. - View Dependent Claims (36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48)
-
-
49. A lock manager, comprising:
-
means for receiving, from a first stream executing a first thread, a request to obtain a lock on a resource;
means for granting the first stream a lock on the resource;
means for receiving, from a second stream executing a second thread, a request to obtain a lock on the resource;
means for determining that the resource is currently locked; and
means for adding, in response to a determination that the resource is currently locked, the second stream to a wait list of streams waiting to obtain a lock on the resource, wherein the wait list indicates that the second stream follows the first stream in obtaining a lock on the resource. - View Dependent Claims (50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62)
-
-
63. A multi-threaded processing engine, comprising:
-
a first stream capable of executing a first thread;
a second stream capable of executing a second thread; and
a lock manager, wherein the lock manager comprises;
means for receiving, from the first stream, a request to obtain a lock on a resource;
means for granting the first stream a lock on the resource;
means for receiving, from the second stream, a request to obtain a lock on the resource;
means for determining that the resource is currently locked; and
means for adding, in response to a determination that the resource is currently locked, the second stream to a wait list of streams waiting to obtain a lock on the resource, wherein the wait list indicates that the second stream follows the first stream in obtaining a lock on the resource. - View Dependent Claims (64, 65, 66, 67, 68, 69, 70, 71, 72)
-
-
73. A method implemented by a lock manager in a multi-threaded environment, comprising:
-
receiving, from a particular thread, a request to obtain a lock on a resource;
determining whether the resource is currently locked by another thread;
in response to a determination that the resource is currently locked by another thread, adding the particular thread to a wait list of threads waiting to obtain a lock on the resource;
determining, at a later time based upon the wait list, that it is the particular thread'"'"'s turn to obtain a lock on the resource; and
granting the particular thread a lock on the resource. - View Dependent Claims (74, 75, 76)
-
-
77. A lock manager, comprising:
-
means for receiving, from a particular thread, a request to obtain a lock on a resource;
means for determining whether the resource is currently locked by another thread;
means for adding, in response to a determination that the resource is currently locked by another thread, the particular thread to a wait list of threads waiting to obtain a lock on the resource;
means for determining, at a later time based upon the wait list, that it is the particular thread'"'"'s turn to obtain a lock on the resource; and
means for granting the particular thread a lock on the resource. - View Dependent Claims (78, 79, 80)
-
Specification