Method and system for dynamically bounded spinning threads on a contested mutex
First Claim
Patent Images
1. A method for managing a mutex in a data processing system, the method comprising:
- maintaining a spinning thread count value for a number of threads that are spinning on a mutex;
attempting to acquire the mutex by a first thread; and
in response to a determination that the mutex has already been acquired by a second thread, determining to enter a spin state or a sleep state on the first thread based on the spinning thread count value.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for managing a mutex in a data processing system is presented. For each mutex, a count is maintained of the number of threads that are spinning while waiting to acquire a mutex. If a thread attempts to acquire a locked mutex, then the thread enters a spin state or a sleep state based on restrictive conditions and the number of threads that are spinning during the attempted acquisition. In addition, the relative length of time that is required by a thread to spin on a mutex after already sleeping on the mutex may be used to regulate the number of threads that are allowed to spin on the mutex.
123 Citations
20 Claims
-
1. A method for managing a mutex in a data processing system, the method comprising:
-
maintaining a spinning thread count value for a number of threads that are spinning on a mutex;
attempting to acquire the mutex by a first thread; and
in response to a determination that the mutex has already been acquired by a second thread, determining to enter a spin state or a sleep state on the first thread based on the spinning thread count value. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A computer program product on a computer readable medium for use in a data processing system for managing a mutex, the computer program product comprising:
-
means for maintaining a spinning thread count value for a number of threads that are spinning on a mutex;
means for attempting to acquire the mutex by a first thread; and
means for determining to enter a spin state or a sleep state on the first thread based on the spinning thread count value in response to a determination that the mutex has already been acquired by a second thread. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17)
-
-
18. An apparatus for managing a mutex, the apparatus comprising:
-
means for maintaining a spinning thread count value for a number of threads that are spinning on a mutex;
means for attempting to acquire the mutex by a first thread; and
means for determining to enter a spin state or a sleep state on the first thread based on the spinning thread count value in response to a determination that the mutex has already been acquired by a second thread. - View Dependent Claims (19, 20)
-
Specification