Method and system for autonomically adaptive mutexes by considering acquisition cost value
First Claim
1. A method for managing a mutex in a data processing system, the method comprising:
- maintaining an average acquisition cost value for a mutex;
attempting to acquire the mutex by a first thread;
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 average acquisition cost value for the mutex;
maintaining a thread-specific current acquisition cost value that represents a consumption of computational resources by the first thread after an initial attempt to acquire the mutex and prior to acquiring the mutex; and
in response to the first thread acquiring the mutex, recomputing the average acquisition cost value for the mutex to include the thread-specific current acquisition cost value.
1 Assignment
0 Petitions
Accused Products
Abstract
A method for managing a mutex in a data processing system is presented. For each mutex, an average acquisition cost is maintained that indicates an average consumption of computational resources that has been incurred by threads attempting to acquire the 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 average acquisition cost value for the mutex at that time. A thread-specific current acquisition cost value is maintained that represents the consumption of computational resources by the thread after the initial attempt to acquire the mutex and prior to acquiring the mutex. When the thread acquires the mutex, the thread-specific current acquisition cost value is included into the average acquisition cost value.
-
Citations
30 Claims
-
1. A method for managing a mutex in a data processing system, the method comprising:
-
maintaining an average acquisition cost value for a mutex; attempting to acquire the mutex by a first thread; 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 average acquisition cost value for the mutex; maintaining a thread-specific current acquisition cost value that represents a consumption of computational resources by the first thread after an initial attempt to acquire the mutex and prior to acquiring the mutex; and in response to the first thread acquiring the mutex, recomputing the average acquisition cost value for the mutex to include the thread-specific current acquisition cost value. - View Dependent Claims (2, 3)
-
-
4. A method for managing a mutex in a data processing system, the method comprising:
-
maintaining an average acquisition cost value for 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 average acquisition cost value for the mutex entering a spin state if the average acquisition cost value satisfies a first condition; and entering a sleep state if the average acquisition cost value satisfies a second condition; wherein the first condition is that the average acquisition cost value is less than a threshold value, and wherein the second condition is that the average acquisition cost value is greater than or equal to a threshold value. - View Dependent Claims (5)
-
-
6. A method for managing a mutex in a data processing system, the method comprising:
-
maintaining an average acquisition cost value for a mutex; attempting to acquire the mutex by a first thread; 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 average acquisition cost value for the mutex; entering a spin state or a sleep state on the first thread; and after exiting the spin state or the sleep state on the first thread, computing or retrieving a cost value that indicates a consumption of computational resources by the first thread during the spin state or the sleep state. - View Dependent Claims (7, 8, 9, 10)
-
-
11. An apparatus for managing a mutex in a data processing system, the apparatus comprising:
-
means for maintaining an average acquisition cost value for a mutex; means for attempting to acquire the mutex by a first thread; means for determining to enter a spin state or a sleep state on the first thread based on the average acquisition cost value for the mutex in response to a determination that the mutex has already been acquired by a second thread; means for maintaining a thread-specific current acquisition cost value that represents a consumption of computational resources by the first thread after an initial attempt to acquire the mutex and prior to acquiring the mutex; and means for recomputing the average acquisition cost value for the mutex to include the thread-specific current acquisition cost value in response to the first thread acquiring the mutex. - View Dependent Claims (12, 13)
-
-
14. An apparatus for managing a mutex in a data processing system, the apparatus comprising:
-
means for maintaining an average acquisition cost value for a mutex; means for attempting to acquire the mutex by a first thread; means for determining to enter a spin state or a sleep state on the first thread based on the average acquisition cost value for the mutex in response to a determination that the mutex has already been acciuired by a second thread; means for entering a spin state if the average acquisition cost value satisfies a first condition; and means for entering a sleep state if the average acquisition cost value satisfies a second condition;
wherein the first condition is that the average acquisition cost value is less than a threshold value, and wherein the second condition is that the average acquisition cost value is greater than or equal to a threshold value. - View Dependent Claims (15)
-
-
16. An apparatus for managing a mutex in a data processing system, the apparatus comprising:
-
means for maintaining an average acquisition cost value for a mutex; means for attempting to acquire the mutex by a first thread; means for determining to enter a spin state or a sleep state on the first thread based on the average acquisition cost value for the mutex in response to a determination that the mutex has already been acquired by a second thread; means for entering a spin state or a sleep state on the first thread; and means for computing or retrieving a cost value that indicates a consumption of computational resources by the first thread during the spin state or the sleep state after exiting the spin state or the sleep state on the first thread. - View Dependent Claims (17, 18, 19, 20)
-
-
21. 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 an average acquisition cost value for a mutex; means for attempting to acquire the mutex by a first thread; means for determining to enter a spin state or a sleep state on the first thread based on the average acquisition cost value for the mutex in response to a determination that the mutex has already been acquired by a second thread; means for maintaining a thread-specific current acquisition cost value that represents a consumption of computational resources by the first thread after an initial attempt to acquire the mutex and prior to acquiring the mutex; and means for recomputing the average acquisition cost value for the mutex to include the thread-specific current acquisition cost value in response to the first thread acquiring the mutex. - View Dependent Claims (22, 23)
-
-
24. 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 an average acquisition cost value for a mutex; means for attempting to acquire the mutex by a first thread; means for determining to enter a spin state or a sleep state on the first thread based on the average acquisition cost value for the mutex in response to a determination that the mutex has already been acquired by a second thread; means for entering a spin state if the average acquisition cost value satisfies a first condition; and means for entering a sleep state if the average acquisition cost value satisfies a second condition; wherein the first condition is that the average acquisition cost value is less than a threshold value, and wherein the second condition is that the average acquisition cost value is greater than or equal to a threshold value. - View Dependent Claims (25)
-
-
26. 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 an average acquisition cost value for a mutex; means for attempting to acquire the mutex by a first thread; means for determining to enter a spin state or a sleep state on the first thread based on the average acquisition cost value for the mutex in response to a determination that the mutex has already been acquired by a second thread; means for entering a spin state or a sleep state on the first thread; and means for computing or retrieving a cost value that indicates a consumption of computational resources by the first thread during the spin state or the sleep state after exiting the spin state or the sleep state on the first thread. - View Dependent Claims (27, 28, 29, 30)
-
Specification