Method and apparatus for scheduling multiple threads for execution in a shared microprocessor pipeline
First Claim
1. A multithreaded processor comprising:
- an instruction buffer for storing instructions for a plurality of threads;
at least one processor core for executing instructions stored in the instruction buffer; and
a scheduler for selecting which of the plurality of threads will have an instruction scheduled for execution by monitoring a current thread state for each of the plurality of threads to determine whether each thread is ready to be scheduled for execution, whether each thread is currently executing and what condition is preventing each thread from executing, where the scheduler selects a first thread having a current thread state indicating that the first thread was least recently scheduled.
1 Assignment
0 Petitions
Accused Products
Abstract
An apparatus and method for scheduling execution of multiple threads on a shared processor resource is described in connection with a multithreaded multiprocessor chip. Using a thread selection policy that switches between available threads every cycle to give priority to the least recently executed or scheduled threads, different threads are able to operate in a way that ensures no deadlocks or livelocks while maximizing aggregate performance and fairness between threads. Prioritization is accomplished by monitoring and sorting thread status information for each thread, including speculative states in which a thread may be speculatively scheduled, thereby improving usage of the execution pipeline by switching a thread in with a lower priority.
-
Citations
20 Claims
-
1. A multithreaded processor comprising:
-
an instruction buffer for storing instructions for a plurality of threads;
at least one processor core for executing instructions stored in the instruction buffer; and
a scheduler for selecting which of the plurality of threads will have an instruction scheduled for execution by monitoring a current thread state for each of the plurality of threads to determine whether each thread is ready to be scheduled for execution, whether each thread is currently executing and what condition is preventing each thread from executing, where the scheduler selects a first thread having a current thread state indicating that the first thread was least recently scheduled. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. A method for scheduling multiple threads for execution on a shared processor pipeline, comprising:
-
maintaining at least one thread status register to keep track of thread states for each of a plurality of threads, said thread states comprising a ready state, a run state and at least one wait state;
maintaining a thread order register for the plurality of threads to track a thread execution order defining which thread was least recently executed;
scheduling any one or more of the plurality of threads for execution that are in the ready state or the run state by assigning a higher priority to a thread that is in a ready state and a lower priority to a thread that is in a run state, with priority between any two or more threads in a ready state being given to whichever thread was least recently executed. - View Dependent Claims (13, 14, 15, 16, 17, 18)
-
-
19. An article of manufacture having at least one recordable medium having stored thereon one or more executable instructions which, when executed by at least one shared processing device, cause the at least one processing device to schedule execution of multiple threads on said processing device by:
-
tracking a thread state for each of a plurality of threads, where said thread state may comprise a ready state, a speculative ready state, a run state and a speculative run state;
scheduling for execution any one or more of the plurality of threads by assigning a higher priority to a thread that is in a ready state, a lower priority to a thread that is in a speculative ready state, and a lowest priority to a thread that is in either a run state or a speculative run state, with priority between any two or more threads in a ready state or in the speculative ready state being given to whichever thread was least recently executed. - View Dependent Claims (20)
-
Specification