Spin-yielding in multi-threaded systems
First Claim
Patent Images
1. A method for use in a multi-threaded system, comprising the steps of:
- dedicating a processor identified as a spin-yield processor to run a thread while the thread is waiting for a lock acquired by another thread;
a first thread acquiring a first lock to run a program portion on a first processor, wherein running the program portion requires the first lock; and
a second thread, while waiting to acquire the first lock based on a relationship between a context switching threshold and a number of context switches experienced by the second thread within a first defined time period, performs the steps of;
running on the spin-yield processor;
trying to acquire the first lock, wherein the second thread acquires the first lock if the first thread yields the first processor; and
if the second thread does not acquire the first lock, then the second thread repeats the steps of running and trying;
wherein the second thread, before running on the spin-yield processor the first time, performs the steps of;
running on the first processor; and
trying to acquire the first lock;
if the second thread does not acquire the first lock, then the second thread repeats the steps of running on the first processor and trying to acquire the first lock.
3 Assignments
0 Petitions
Accused Products
Abstract
Techniques are provided for use in spin-yielding in multi-threaded systems. Each thread that is waiting for a lock is bound to a spin-yield processor in the list of a plurality of spin-yield processors so that other processors that otherwise may be used for spin-yield cycles by the waiting threads can be used for other purposes by other threads. Further, in a defined time period, a thread is bound to or removed from a spin-yield processor based on the number of context switches experienced by that thread in that defined time period.
-
Citations
20 Claims
-
1. A method for use in a multi-threaded system, comprising the steps of:
-
dedicating a processor identified as a spin-yield processor to run a thread while the thread is waiting for a lock acquired by another thread; a first thread acquiring a first lock to run a program portion on a first processor, wherein running the program portion requires the first lock; and a second thread, while waiting to acquire the first lock based on a relationship between a context switching threshold and a number of context switches experienced by the second thread within a first defined time period, performs the steps of; running on the spin-yield processor; trying to acquire the first lock, wherein the second thread acquires the first lock if the first thread yields the first processor; and if the second thread does not acquire the first lock, then the second thread repeats the steps of running and trying; wherein the second thread, before running on the spin-yield processor the first time, performs the steps of; running on the first processor; and trying to acquire the first lock; if the second thread does not acquire the first lock, then the second thread repeats the steps of running on the first processor and trying to acquire the first lock. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A system comprising:
-
a processor dedicated to run a thread that is waiting for a lock acquired by another thread; the processor being identified as a spin-yield processor; a first thread acquiring a first lock to run a program portion on a first processor, wherein running the program portion requires the first lock; and a second thread, while waiting to acquire the first lock based on a relationship between a context switching threshold and a number of context switches experienced by the second thread within a first defined time period, performs the steps of; running on the spin-yield processor trying to acquire the first lock, wherein the second thread acquires the first lock if the first thread yields the first processor; and if the second thread does not acquire the first lock, then the second thread repeats the steps of running and trying; wherein the second thread, before running on the spin-yield processor the first time, performs the steps of; running on the first processor; and trying to acquire the first lock; if the second thread does not acquire the first lock, then the second thread repeats the steps of running on the first processor and trying to acquire the first lock. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. A computer-readable medium wherein said computer readable medium is a medium selected from the group consisting of a floppy disk, a hard disk, a zip-drive cartridge, a magnetic tape, a magnetic medium, a DC-ROM, a CD-RAM, a DVD-ROM, a DVD-RAM, an optical medium, a paper tape, a punch card, a pattern of holes, a RAM, a ROM, an EPROM, a memory chip, and a memory cartridge, said computer readable medium embodying instructions for use in a multi-threaded system, the instructions performing the steps of:
-
defining a time period; determining a number of context switches experienced by a thread during the defined time period, wherein the thread is waiting for a lock acquired by another thread; and based on a relationship between a context switch threshold and the number of context switches, if the thread has not been bound to a spin-yield processor then binding the thread to the spin-yield processor, else if the thread has been bound to the spin-yield process, then unbinding the thread from the spin-yield processor; wherein the spin-yield processor is a processor being dedicated to run the thread, wherein the thread acquires the lock if the other thread yields the lock; wherein the other thread, before running on the spin-yield processor the first time, performs the steps of; running on a first processor; and trying to acquire the lock; if the other thread does not acquire the lock, then the other thread repeats the steps of running on the first processor and trying to acquire the lock. - View Dependent Claims (18, 19, 20)
-
Specification