Optimized Preemption and Reservation of Software Locks
First Claim
1. A computer-implemented method comprising:
- releasing a software lock by a first thread;
identifying a second thread waiting on the software lock at the time of the releasing;
establishing a reservation to the software lock by the second thread in response to the identifying;
waking the second thread in response to the releasing;
after the establishment of the reservation and before the software lock has been taken by the second thread, receiving a first request for the software lock by a first requesting thread that is not the second thread; and
denying the request and putting the first requesting thread to sleep in response to the second thread having a priority equal to or better than the first requesting thread.
0 Assignments
0 Petitions
Accused Products
Abstract
An approach is provided that reserves a software lock for a waiting thread is presented. When a software lock is released by a first thread, a second thread that is waiting for the same resource controlled by the software lock is woken up. In addition, a reservation to the software lock is established for the second thread. After the reservation is established, if the lock is available and requested by a thread other than the second thread, the requesting thread is denied, added to the wait queue, and put to sleep. In addition, the reservation is cleared. After the reservation has been cleared, the lock will be granted to the next thread to request the lock.
-
Citations
20 Claims
-
1. A computer-implemented method comprising:
-
releasing a software lock by a first thread; identifying a second thread waiting on the software lock at the time of the releasing; establishing a reservation to the software lock by the second thread in response to the identifying; waking the second thread in response to the releasing; after the establishment of the reservation and before the software lock has been taken by the second thread, receiving a first request for the software lock by a first requesting thread that is not the second thread; and denying the request and putting the first requesting thread to sleep in response to the second thread having a priority equal to or better than the first requesting thread. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. An information handling system comprising:
-
one or more processors; a memory accessible by the processors; a plurality of threads, including a first thread and a second thread, stored in the memory and executed by the processors; a software lock that controls access to a resource; and a set of instructions executed by the processors to perform actions of; releasing the software lock by the first thread; identifying a second thread waiting on the software lock at the time of the releasing; establishing a reservation to the software lock by the second thread in response to the identifying; waking the software lock in response to the identifying; after the establishment of the reservation and before the software lock has been taken by the second thread, receiving a first request for the software lock by a first requesting thread that is not the second thread; and denying the request and putting the first requesting thread to sleep in response to the second thread having a priority equal to or better than the first requesting thread. - View Dependent Claims (9, 10, 11, 12, 13)
-
-
14. A computer program product in a computer-readable medium comprising functional descriptive material that, when executed by a computer, directs the computer to perform actions of:
-
releasing a software lock by a first thread; identifying a second thread waiting on the software lock at the time of the releasing; establishing a reservation to the software lock by the second thread in response to the identifying; waking the software lock in response to the identifying; after the establishment of the reservation and before the software lock has been taken by the second thread, receiving a first request for the software lock by a first requesting thread that is not the second thread; and denying the request and putting the first requesting thread to sleep in response to the second thread having a priority equal to or better than the first requesting thread. - View Dependent Claims (15, 16, 17, 18, 19, 20)
-
Specification