Resource accessing with locking
First Claim
1. A system for thread handling, the system comprising:
- at least one processor;
a target resource;
a first thread to handle a first access request to at least the target resource; and
a resource locking mechanism to release the first thread during the handling of the first access request for the target resource when the resource locking mechanism determines that the target resource is already locked for access by a write access request, so that the released first thread is capable of handling at least a second access request,and to permit the first access request handled by the first thread to access the target resource when the resource locking mechanism determines that the first access request is a first read access request and the target resource is already locked for access by a second read access request a second thread to handle a second access request to at least the target resource, wherein the resource locking mechanism is to permit the second access request handled by the second thread to access the target resource when the resource locking mechanism determines that the second access request is third read access request and the target resource is already locked for access by the second read access request.
2 Assignments
0 Petitions
Accused Products
Abstract
Thread usage is managed when locking resources during the possibly-contentious accessing of such resources. In a described implementation, a thread that is executing a corresponding access request is not suspended when its corresponding access request is delayed because a targeted resource is currently locked for accessing by another thread. Instead, when a targeted resource is locked, the blocked access request is queued up in a queue of access requests. The corresponding thread is then permitted to perform other work. When the resource is subsequently unlocked and thus becomes available, an access request (e.g., the oldest or highest priority access request) that is queued is retrieved, and a thread is allowed to execute it. Implementations for general locking access schemes, for read/write-bifurcated locking access schemes, etc. are described. Implementations are described from conceptual, functional, temporal, code or function, contention, thread, and other perspectives.
66 Citations
19 Claims
-
1. A system for thread handling, the system comprising:
-
at least one processor; a target resource; a first thread to handle a first access request to at least the target resource; and a resource locking mechanism to release the first thread during the handling of the first access request for the target resource when the resource locking mechanism determines that the target resource is already locked for access by a write access request, so that the released first thread is capable of handling at least a second access request, and to permit the first access request handled by the first thread to access the target resource when the resource locking mechanism determines that the first access request is a first read access request and the target resource is already locked for access by a second read access request a second thread to handle a second access request to at least the target resource, wherein the resource locking mechanism is to permit the second access request handled by the second thread to access the target resource when the resource locking mechanism determines that the second access request is third read access request and the target resource is already locked for access by the second read access request. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. One or more processor-accessible storage media comprising processor-executable instructions that include at least one application programming interface (API), the at least one API to handle access requests for a resource;
- the at least one API to
queue a first access request and to release a first thread executing the first access request without suspending the first thread when the resource is already write locked, and to permit the first access request to be performed on the resource when the first access request is a read access request and the resource is already read locked, and permit a second access request that is executed by a second thread to access the resource when the second access request is a second read access request and the resource is already read locked. - View Dependent Claims (8, 9, 10, 11, 12, 13, 14)
- the at least one API to
-
15. A method implemented by a device, the method comprising:
-
starting, by a first thread, performance of a first access request that is targeting a resource; detecting, by the first thread, that the resource is already locked for a read access or a write access by a second thread; performing, by the first thread, the first access request when the resource is already locked for the read access by the second thread and the first access request is a read access request; queuing, by the first thread, the first access request when the resource is already locked for the write access by the second thread; completing, by a third thread, performance of the first access request when the resource is no longer locked for write access by the second thread, and performing, by a fourth thread, a second access request that is targeting the resource when the resource is already locked for the read access by the second thread and the second access request is another read access request. - View Dependent Claims (16, 17, 18, 19)
-
Specification