IP Library › Granted Patent US 8,701,111
Granted Patent B2
US 8,701,111 · App. 12/170,101 · Granted Apr 15, 2014

Lock windows for reducing contention

Inventors: Nathan Fontenot (Georgetown, TX); Jacob L. Moilanen (Austin, TX); Joel H. Schopp (Austin, TX); Michael T. Strosaker (Austin, TX); Mark W. VanderWiele (Austin, TX)
Assignee: International Business Machines Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,701,111
App. No.
12/170,101
Granted
Apr 15, 2014
Kind
B2
Abstract

Methods and arrangements to assign locks to threads are discussed. Embodiments include transformations, code, state machines or other logic to assign locks to threads. Embodiments may include setting a window of time at the end of a time slice of a thread. The embodiment may also involve prohibiting the thread from acquiring a lock during the window of time, based upon determining that the thread is within the window of time and determining that the thread does not hold any locks. Other embodiments include an apparatus to assign locks to threads and a computer program product to assign locks to threads.

Claims (43)

1. A method of assigning locks to threads, the method comprising:

setting a window of time at the end of a time slice of a non-suspended thread, the time slice including a scheduled end and the window of time including a period of time that starts before the scheduled end of the time slice;

determining that the thread has requested a lock within the window of time;

prohibiting the thread from acquiring a lock during the window of time, based upon determining that the thread is within the window of time and determining that the thread does not hold any locks; and

timing out the thread for the remainder of the time slice of the thread.

2. The method of claim 1 , further comprising:

registering an area of memory to store the start of the window of time; and

storing in the area of memory the start of the window of time based upon the scheduling of the thread.

3. The method of claim 2 , wherein the allocating is allocating an area of memory in RAM.

4. The method of claim 2 , wherein the allocating is allocating an area of memory in a register.

5. The method of claim 1 , wherein the setting comprises tuning the duration of the window of time.

6. A method of assigning locks to threads, the method comprising:

setting a window of time at the end of a time slice of a non-suspended thread, the time slice including a scheduled end and the window of time including a start time, wherein the start time of the window of time is determined based at least in part on the size of the window of time and the scheduled end of the time slice;

determining that the thread has released a lock within the window of time;

determining that the thread holds no other locks; and

prohibiting the thread from acquiring a lock during the window of time and timing out the thread for the remainder of the time slice of the thread, based upon determining that the thread is within the window of time, determining that the thread has requested a lock within the window of time and determining that the thread does not hold any locks.

7. The method of claim 6 , wherein:

the method further comprises:

registering by a thread library an area of memory to store the start of the window of time;

scheduling the thread;

communicating by a kernel to the thread library the start of the window of time; and

storing in the area of memory the start of the window of time; and

determining that the thread has released a lock within the window of time and determining that the thread holds no other locks comprise determining by the thread library that the thread has released a lock within the window of time and determining by the thread library that the thread holds no other locks.

8. The method of claim 6 , wherein the setting comprises selecting a percentage and multiplying the time slice of the thread by the percentage.

9. An apparatus to assign locks to threads, the apparatus comprising:

a window of time determiner to set a window of time at the end of a time slice of a non-suspended thread, the time slice including a scheduled end and the window of time including a period of time that starts before the scheduled end of the time slice; and

a lock supervisor to prohibit the thread from acquiring a lock during the window of time and to time out the thread for the remainder of the time slice of the thread, based upon determining that the thread is within the window of time and determining that the thread does not hold any locks and determining that the thread has requested a lock within the window of time.

10. The apparatus of claim 9 , wherein the apparatus further comprises a thread scheduler, and the apparatus is to register an area of memory to store the start of the window of time, and to store in the area of memory the start of the window of time based upon the scheduling of the thread.

11. The apparatus of claim 9 , wherein:

the lock supervisor is to determine that the thread has released a lock within the window of time and that the thread holds no other locks; and

the apparatus is to time out the thread for the remainder of the time slice of the thread.

12. A computer program product for assigning locks to threads, the computer program product comprising a non-transitory computer useable medium having a computer usable program code embodied therewith, the computer usable program code comprising:

computer usable program code configured to set a window of time at the end of a time slice of a non-suspended thread, the time slice including a scheduled end and the window of time including a period of time that starts before the scheduled end of the time slice; and

computer usable program code configured to prohibit the thread from acquiring a lock during the window of time and to time out the thread for the remainder of the time slice of the thread, based upon determining that the thread is within the window of time, determining that the thread does not hold any locks and determining that the thread has requested a lock within the window of time.

13. The computer program product of claim 12 , the computer usable program code further comprising:

computer usable program code configured to register an area of memory to store the start of the window of time; and

computer usable program code configured to store in the area of memory the start of the window of time based upon the scheduling of the thread.

14. The computer program product of claim 12 , wherein the computer usable program code configured to allocate comprises computer usable program code configured to allocate an area of memory in RAM.

15. The computer program product of claim 12 , wherein the computer usable program code configured to allocate comprises computer usable program code configured to allocate an area of memory in a register.

16. The computer program product of claim 12 , wherein the computer usable program code configured to prohibit and to determine the thread does not hold any locks comprise comprises:

computer usable program code configured to determine that the thread has released a lock within the window of time.

17. The computer program product of claim 12 , wherein the computer usable program code configured to set a window of time comprises computer usable program code configured to selecting a percentage and to multiply the time slice by the percentage.

18. The computer program product of claim 12 , wherein the computer usable program code configured to set a window of time comprises computer usable program code configured to tune the duration of the window of time.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 15, 2008
From: FONTENOT, NATHAN; MOILANEN, JACOB L.; SCHOPP, JOEL H.; STROSAKER, MICHAEL T.; VANDERWIELE, MARK W.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 021240/0267 →
Continuity (1)
Related Publication 20100011360A1 · Jan 14, 2010