Fast transfer of workload between multiple processors
First Claim
1. A method comprising:
- detecting, by a producer thread running on a first processor, an external interrupt;
acquiring, by the producer thread, a spinlock;
in response to acquiring the spinlock, sending, by the producer thread, an event to the consumer thread;
while the consumer thread wakes up;
creating, by the producer thread, a task, andpublishing, by the producer thread, the created task;
in response to publishing the created task, releasing, by the producer thread, the spinlock;
in response to releasing the spinlock, retrieving, by a consumer thread running on a second processor, the published task; and
executing, by the consumer thread, the retrieved task.
1 Assignment
0 Petitions
Accused Products
Abstract
Techniques and systems for prescheduling an alternative CPU as soon as a need for a task is detected by a primary CPU are disclosed. A process includes detecting, by a producer thread running on a first CPU, an external interrupt, acquiring, by the producer thread, a spinlock, and in response to acquiring the spinlock, sending, by the producer thread, an event to a consumer thread that is to run on a second CPU. Upon receiving the event by the consumer thread, the consumer thread acquires the spinlock, which “stalls” the consumer thread in a loop until the spinlock is released by the producer thread. While the consumer thread is “waking up” in response to receiving the event from the producer thread, the producer thread creates a task, publishes the task, and releases the spinlock, thereby causing the consumer thread to exit the loop, retrieve the task, and execute the task.
26 Citations
20 Claims
-
1. A method comprising:
-
detecting, by a producer thread running on a first processor, an external interrupt; acquiring, by the producer thread, a spinlock; in response to acquiring the spinlock, sending, by the producer thread, an event to the consumer thread; while the consumer thread wakes up; creating, by the producer thread, a task, and publishing, by the producer thread, the created task; in response to publishing the created task, releasing, by the producer thread, the spinlock; in response to releasing the spinlock, retrieving, by a consumer thread running on a second processor, the published task; and executing, by the consumer thread, the retrieved task. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A system comprising:
-
multiple processors including a first processor and a second processor; and memory storing computer-executable instructions that, when executed by at least one processor of the multiple processors, cause the at least one processor to perform operations comprising; executing, by the second processor, an instruction causing the second processor to wait for an event; executing a producer thread on the first processor based at least in part on an interrupt detected by the first processor; when the interrupt is detected, setting, by the producer thread, a parameter associated with a synchronization primitive to a first value; in response to setting the parameter to the first value, sending, by the producer thread, the event to the second processor; executing a consumer thread on the second processor based at least in part on the second processor receiving the event; performing, by the consumer thread, loading operations; while the consumer thread performs the loading operations; creating, by the producer thread, a task, publishing, by the producer thread, the task for consumption, and in response to publishing the task for consumption, setting, by the producer thread, the parameter to a second value; in response to setting the parameter to the second value, retrieving, by the consumer thread, the task; and executing, by the consumer thread, the task. - View Dependent Claims (9, 10, 11, 12, 20)
-
-
13. A method comprising:
-
detecting, by a producer thread running on a first processor, an external interrupt; setting, by the producer thread, in response to the external interrupt, a parameter associated with a spinlock to a first value; in response to setting the parameter to the first value, sending, by the producer thread, an event to a consumer thread running on a second processor; performing, by the consumer thread, loading operations; while the consumer thread performs the loading operations; creating, by the producer thread, a task, publishing, by the producer thread, the created task, and in response to publishing the created task, setting, by the producer thread, the parameter to a second value; setting, by the consumer thread, the parameter to the first value; retrieving, by the consumer thread, the published task; and executing, by the consumer thread, the retrieved task. - View Dependent Claims (14, 15, 16, 17, 18, 19)
-
Specification