Back to results
US 8,544,020 B1Granted
Cooperative preemption
AssigneeAzul Systems, Inc.
InventorsGil Tene, Michael A. Wolf, Scott Sellers, Jack H. Choquette
Life of this patent
Estimating the term…
Abstract
Preempting the execution of a thread is disclosed. Preempting includes receiving an indication that a preemption of the thread is desired and context switching the thread out at a thread safe point in the event that a thread safe point is reached.
Claims38
A method of preempting the execution of a thread, including:
- receiving at a processor a first indication that a preemption of a first thread is desired in order to execute a second thread;
- in response to receiving the first indication, waiting for the first thread to reach a thread safe point, the thread safe point being a point in code at which if the first thread were to stop at the thread safe point, an operation that a third thread may want to perform on the first thread can be performed, wherein the first thread, the second thread and the third thread are different threads;
- in the event that the first thread reaches a thread safe point, context switching the first thread out at the thread safe point and context switching the second thread in;
- in the event that the first thread has not reached a thread safe point and it is detected that a second indication has been received, in response to the detection, preemptively context switching the first thread out and context switching the second thread in;
- and
- in the case of a single processor system, in the event that a fourth thread requests that all other threads be at a safe point, and each of the other threads has already entered a thread safe point, begin executing the fourth thread immediately.
3 more elements
A system for preempting the execution of a thread, including:
- a processor configured to:
- receive at a processor a first indication that a preemption of a first thread is desired in order to execute a second thread;
- in response to receiving the first indication, wait for the first thread to reach a thread safe point, the thread safe point being a point in code at which if the first thread were to stop at the thread safe point, an operation that a third thread may want to perform on the first thread can be performed, wherein the first thread, the second thread and the third thread are different threads;
- in the event that the first thread reaches a thread safe point, context switch the first thread out at the thread safe point and context switching the second thread in;
- in the event that the first thread has not reached a thread safe point and it is detected that a second indication has been received, in response to the detection, preemptively context switch the first thread out and context switch the second thread in;
- and
- in the case of a single processor system, in the event that a fourth thread requests that all other threads be at a safe point, and each of the other threads has already entered a thread safe point, begin executing the fourth thread immediately;
- and
- a memory coupled with the processor, wherein the memory provides the processor with instructions.
6 more elements
A computer program product for preempting the execution of a thread, the computer program product being embodied in a non-transitory computer readable medium and comprising computer instructions for:
- receiving at a processor a first indication that a preemption of a first thread is desired in order to execute a second thread;
- in response to receiving the first indication, waiting for the first thread to reach a thread safe point, the thread safe point being a point in code at which if the first thread were to stop at the thread safe point, an operation that a third thread may want to perform on the first thread can be performed, wherein the first thread, the second thread and the third thread are different threads;
- in the event that the first thread reaches a thread safe point, context switching the first thread out at the thread safe point and context switching the second thread in;
- in the event that the first thread has not reached a thread safe point and it is detected that a second indication has been received, in response to the detection, preemptively context switching the first thread out and context switching the second thread in;
- and
- in the case of a single processor system, in the event that a fourth thread requests that all other threads be at a safe point, and each of the other threads has already entered a thread safe point, begin executing the fourth thread immediately.
3 more elements
Dependencies are inferred from the claim text.