Storing contexts for thread switching
First Claim
Patent Images
1. An electronic device, comprising:
- a processor configured to execute a first thread and a second thread;
a memory coupled to the processor and configured to store a first stack used by the first thread,wherein the processor is further configured to switch from execution of the first thread to execution of the second thread by halting the first thread at a switch point; and
executing a minimum context push instruction comprised in a first instruction set of the processor, wherein execution of the minimum context push instruction pushes a minimum context of the first thread onto the first stack, wherein the minimum context comprises at least a program counter and a status register; and
wherein the memory is further configured to store a second stack used by the second thread, and the processor is further configured to switch by executing a minimum context POP instruction comprised in the first instruction set of the processor, wherein execution of the minimum context pop instruction pop a minimum context of the second thread from the second stack.
1 Assignment
0 Petitions
Accused Products
Abstract
An electronic device comprising decode logic that decodes instructions and a stack coupled to the decode logic. A group of instructions causes the decode logic to push onto the stack, after halting processing of a first thread at a switch point and prior to processing a second thread, a minimum amount of information needed to resume execution of the first thread at the switch point and not information not needed to resume execution of the first thread at the switch point.
-
Citations
14 Claims
-
1. An electronic device, comprising:
-
a processor configured to execute a first thread and a second thread; a memory coupled to the processor and configured to store a first stack used by the first thread, wherein the processor is further configured to switch from execution of the first thread to execution of the second thread by halting the first thread at a switch point; and executing a minimum context push instruction comprised in a first instruction set of the processor, wherein execution of the minimum context push instruction pushes a minimum context of the first thread onto the first stack, wherein the minimum context comprises at least a program counter and a status register; and wherein the memory is further configured to store a second stack used by the second thread, and the processor is further configured to switch by executing a minimum context POP instruction comprised in the first instruction set of the processor, wherein execution of the minimum context pop instruction pop a minimum context of the second thread from the second stack. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A processor configured to switch between a first thread and a second thread executable on the processor, the processor comprising:
-
a memory adapted to store a first stack used by the first thread; and a decode logic adapted to decode a minimum context push instruction retrieved from the memory at a switch point in the first thread, wherein the minimum context push instruction is in a first instruction set of the processor, and wherein execution of the minimum context push instruction causes the processor to push onto the first stack a minimum context of the first thread, wherein the minimum context comprises at least a program counter and a status register, and wherein the memory is further adapted to store a second stack used by the second thread, and the decode logic is further adapted to decode a minimum context pop instruction retrieved from the memory at the switch point, wherein the minimum context pop instruction is in the first instruction set of the processor, and wherein execution of the minimum context pop instruction causes the processor to pop a minimum context of the second thread from the second stack. - View Dependent Claims (7, 8, 9)
-
-
10. A method for switching from a first thread executing on a processor to a second thread executing on the processor, the method comprising:
switching from execution of the first thread to execution of the second thread by halting the first thread at a switch point; executing a minimum context push instruction comprised in a first instruction set of the processor, wherein execution of the minimum context push instruction pushes a minimum context of the first thread onto a first stack used by the first thread, wherein the minimum context comprises at least a program counter and a status register; and executing a minimum context pop instruction comprised in the first instruction set of the processor, wherein execution of the minimum context pop instruction pop a minimum context of the second thread from a second stack used by the second thread. - View Dependent Claims (11, 12, 13, 14)
Specification