System and method for dynamically determining a thread to perform work using a lockable resource
First Claim
Patent Images
1. A method comprising:
- a first thread desiring to perform work using a resource;
the first thread determining whether another thread holds a lock on the resource; and
if another thread (“
blocking thread”
) holds a lock on the resource, transferring the work to the blocking thread for performance of the work by the blocking thread using the resource.
2 Assignments
0 Petitions
Accused Products
Abstract
According to at least one embodiment, a method comprises a first thread desiring to perform work using a resource. The first thread determines whether another thread holds a lock on the resource, and if another thread (“blocking thread”) holds a lock on the resource, the work is transferred to the blocking thread for performance of the work by the blocking thread using the resource.
59 Citations
23 Claims
-
1. A method comprising:
-
a first thread desiring to perform work using a resource;
the first thread determining whether another thread holds a lock on the resource; and
if another thread (“
blocking thread”
) holds a lock on the resource, transferring the work to the blocking thread for performance of the work by the blocking thread using the resource. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A method comprising:
-
attempting, by a thread that desires to use a resource for performing work, trylock on the resource;
if said trylock is unsuccessful, the thread placing a description of the work in a pending queue associated with the resource, and a thread that holds a lock on the resource performs the work. - View Dependent Claims (8, 9)
-
-
10. A method comprising:
-
attempting, by a thread that desires to use a resource for performing work, trylock on the resource;
if said trylock is successful, said thread holds a lock on the resource and performs the work;
if said trylock is unsuccessful, said thread places a description of the work in a pending queue associated with the resource; and
after a thread holding a lock on the resource performs work using the resource, the thread holding the lock performs any work identified in the pending queue before unlocking the resource. - View Dependent Claims (11, 12)
-
-
13. A system comprising:
-
processor for executing a plurality of threads;
a lockable resource usable by said plurality of threads;
said threads each operable to dynamically determine a thread to use the lockable resource for performing work desired by a thread, wherein a first thread desiring to perform work using the lockable resource is operable to determine whether a lock is available for the resource;
wherein if said lock is determined available for the lockable resource, the first thread is operable to hold the lock on the lockable resource and use the lockable resource to perform the work; and
wherein if said lock is determined not available for the lockable resource, the first thread is operable to place a description of the work it desires to perform in a pending queue associated with the resource. - View Dependent Claims (14, 15, 16)
-
-
17. A multi-threaded system comprising:
-
a lockable resource that is usable by a plurality of threads, said lockable resource comprising a first lockable means for performing work of a thread and a second lockable means for queuing pending work desired to be performed using the first lockable means;
means for determining, upon a thread desiring to perform work using the first lockable means of said lockable resource, whether another thread holds a lock on the first lockable means;
means for placing a description of the work in said second lockable means for performance of the work by said another thread that holds said lock on the first lockable means, if determined by the determining means that said another thread holds said lock on the first lockable means. - View Dependent Claims (18, 19, 20, 21)
-
-
22. A system comprising:
-
a plurality of threads;
a partitioned queue that comprises a plurality of partitions;
each thread operable to add a work description in the partitioned queue and remove a work description from the partitioned queue; and
each thread further operable to dynamically determine which of the plurality of partitions to use for adding said work description in the partitioned queue or removing said work description from the partitioned queue, thereby dynamically determining which of said plurality of threads is to perform work described by a work description. - View Dependent Claims (23)
-
Specification