IP Library › Granted Patent US 9,378,069
Granted Patent B2
US 9,378,069 · App. 14/197,581 · Granted Jun 28, 2016

Lock spin wait operation for multi-threaded applications in a multi-core computing environment

Inventors: Men-Chow Chiang (Austin, TX); Ken V. Vu (Cary, NC)
Assignee: International Business Machines Corporation
G06F9/526
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 9,378,069
App. No.
14/197,581
Granted
Jun 28, 2016
Kind
B2
Abstract

A method, system and computer-usable medium are disclosed for a lock-spin-wait operation for managing multi-threaded applications in a multi-core computing environment. A target processor core, referred to as a “spin-wait core” (SWC), is assigned (or reserved) for primarily running spin-waiting threads. Threads operating in the multi-core computing environment that are identified as spin-waiting are then moved to a run queue associated with the SWC to acquire a lock. The spin-waiting threads are then allocated a lock response time that is less than the default lock response time of the operating system (OS) associated with the SWC. If a spin-waiting fails to acquire a lock within the allocated lock response time, the SWC is relinquished, ceding its availability for other spin-waiting threads in the run queue to acquire a lock. Once a spin-waiting thread acquires a lock, it is migrated to its original, or an available, processor core.

Claims (49)

1. A computer-implemented method for managing multi-threaded applications in a multi-core computing system, comprising:

monitoring a plurality of threads to determine whether any of the plurality of threads is a spin-waiting thread;

assigning a first processor core to manage spin waits in a multi-core system;

detecting a failure of a thread to acquire a lock on a second processor core,

the failure to acquire a lock indicating that the thread is a first spin-waiting thread;

transferring the first spin-waiting thread to the first processor core to acquire a lock; and

allocating a lock response time for the first spin-waiting thread to acquire a lock from the first processor.

2. The method of claim 1 , wherein the transferring comprises placing the first spin-waiting thread in a run queue associated with the first processor core, the run queue containing a second spin-waiting thread.

3. The method of claim 2 , wherein the allocated lock-response time is less than the default lock response time of an operating system (OS) associated with the first processor core.

4. The method of claim 3 , further comprising:

issuing an OS call to set a lock state, the OS call issued by the first spin-waiting thread and the lock state providing an indication of a lock acquisition failure by the first spin-waiting thread.

5. The method of claim 4 , further comprising

relinquishing the first processor core to allow the second spin-waiting thread in the run queue to acquire a lock, the relinquishing of the first processor core performed after the OS call has been issued.

6. The method of claim 1 , further comprising:

migrating the first spin-waiting thread to the second processor core subsequent to the first spin-waiting thread acquiring a lock from the first processor core.

7. A system comprising:

a processor;

a data bus coupled to the processor; and

a computer-usable medium embodying computer program code, the computer-usable medium being coupled to the data bus, the computer program code used for managing multi-threaded applications in a multi-core computing system and comprising instructions executable by the processor and configured for:

monitoring a plurality of threads to determine whether any of the plurality of threads is a spin-waiting thread;

assigning a first processor core to manage spin waits in a multi-core system;

detecting a failure of a thread to acquire a lock on a second processor core,

the failure to acquire a lock indicating that the thread is a first spin-waiting thread; transferring the first spin-waiting thread to the first processor core to acquire a lock; and

allocating a lock response time for the first spin-waiting thread to acquire a lock from the first processor.

8. The system of claim 7 , wherein the transferring comprises placing the first spin-waiting thread in a run queue associated with the first processor core, the run queue containing a second spin-waiting thread.

9. The system of claim 8 , wherein the allocated lock-response time is less than the default lock response time of an operating system (OS) associated with the first processor core.

10. The system of claim 9 , further comprising:

issuing an OS call to set a lock state, the OS call issued by the first spin-waiting thread and the lock state providing an indication of a lock acquisition failure by the first spin-waiting thread.

11. The system of claim 10 , further comprising:

relinquishing the first processor core to allow the second spin-waiting thread in the run queue to acquire a lock, the relinquishing of the first processor core performed after the OS call has been issued.

12. The system of claim 7 , further comprising:

migrating the first spin-waiting thread to the second processor core subsequent to the first spin-waiting thread acquiring a lock from the first processor core.

13. A non-transitory, computer-readable storage medium embodying computer program code, the computer program code comprising computer executable instructions configured for:

monitoring a plurality of threads to determine whether any of the plurality of threads is a spin-waiting thread;

assigning a first processor core to manage spin waits in a multi-core system;

detecting a failure of a thread to acquire a lock on a second processor core,

the failure to acquire a lock indicating that the thread is a first spin-waiting thread;

transferring the first spin-waiting thread to the first processor core to acquire a lock; and

allocating a lock response time for the first spin-waiting thread to acquire a lock from the first processor.

14. The non-transitory, computer-readable storage medium of claim 13 , wherein the transferring comprises placing the first spin-waiting thread in a run queue associated with the first processor core, the run queue containing a second spin-waiting thread.

15. The non-transitory, computer-readable storage medium of claim 14 , wherein the allocated lock-response time is less than the default lock response time of an operating system (OS) associated with the first processor core.

16. The non-transitory, computer-readable storage medium of claim 15 , further comprising:

issuing an OS call to set a lock state, the OS call issued by the first spin-waiting thread and the lock state providing an indication of a lock acquisition failure by the first spin-waiting thread.

17. The non-transitory, computer-readable storage medium of claim 16 , further comprising:

relinquishing the first processor core to allow the second spin-waiting thread in the run queue to acquire a lock, the relinquishing of the first processor core performed after the OS call has been issued.

18. The non-transitory, computer-readable storage medium of claim 13 , further comprising:

migrating the first spin-waiting thread to the second processor core subsequent to the first spin-waiting thread acquiring a lock from the first processor core.

19. The non-transitory, computer-readable storage medium of claim 13 , wherein the computer executable instructions are deployable to a client system from a server system at a remote location.

20. The non-transitory, computer-readable storage medium of claim 13 , wherein the computer executable instructions are provided by a service provider to a user on an on-demand basis.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 5, 2014
From: CHIANG, MEN-CHOW; VU, KEN V.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 032353/0904 →
Continuity (1)
Related Publication 20150254113A1 · Sep 10, 2015