Executing multiple threads in a processor
First Claim
Patent Images
1. An article of manufacture comprising a computer readable storage medium including code executed by a processor to access buffers and perform operations, the operations comprising:
- setting credits in processor buffers for a plurality of threads executed by the processor, wherein the credits for a thread comprise a number of credits, wherein a thread having credits can be selected for execution and wherein a thread having no credits is not selected for execution;
executing an operating system scheduler to configure the processor to execute the threads and set the thread credits;
executing the operating system scheduler to allocate main memory addresses to the processor for the processor to use as virtual processor buffers to store status and the thread credits for designated threads, wherein the processor buffers for a first set of threads are maintained in the virtual processor buffers and the processor buffers for a second set of threads are maintained in the processor;
determining threads whose status and credits are in the processor buffers to swap to virtual processor buffers and the status and credits of threads in the virtual processor buffer to swap to the processor buffers, wherein the threads to swap to the virtual processor buffers from the processor buffers have no credits or are in a paused state;
alternating among executing the threads having available credits;
decrementing the credits available for one of the threads to reduce the number of available credits for the thread in response to executing the thread;
setting a replenish flag for a replenish thread to indicate that the replenish thread will not execute until all the other threads have no available credits; and
initiating by the replenish thread an operation to reassign credits to the threads in response to the plurality of the threads other than the replenish thread having no available credits.
1 Assignment
0 Petitions
Accused Products
Abstract
Provided are a method, system, and program for executing multiple threads in a processor. Credits are set for a plurality of threads executed by the processor. The processor alternates among executing the threads having available credit. The processor decrements the credit for one of the threads in response to executing the thread and initiates an operation to reassign credits to the threads in response to depleting all the thread credits.
42 Citations
14 Claims
-
1. An article of manufacture comprising a computer readable storage medium including code executed by a processor to access buffers and perform operations, the operations comprising:
-
setting credits in processor buffers for a plurality of threads executed by the processor, wherein the credits for a thread comprise a number of credits, wherein a thread having credits can be selected for execution and wherein a thread having no credits is not selected for execution; executing an operating system scheduler to configure the processor to execute the threads and set the thread credits; executing the operating system scheduler to allocate main memory addresses to the processor for the processor to use as virtual processor buffers to store status and the thread credits for designated threads, wherein the processor buffers for a first set of threads are maintained in the virtual processor buffers and the processor buffers for a second set of threads are maintained in the processor; determining threads whose status and credits are in the processor buffers to swap to virtual processor buffers and the status and credits of threads in the virtual processor buffer to swap to the processor buffers, wherein the threads to swap to the virtual processor buffers from the processor buffers have no credits or are in a paused state; alternating among executing the threads having available credits; decrementing the credits available for one of the threads to reduce the number of available credits for the thread in response to executing the thread; setting a replenish flag for a replenish thread to indicate that the replenish thread will not execute until all the other threads have no available credits; and initiating by the replenish thread an operation to reassign credits to the threads in response to the plurality of the threads other than the replenish thread having no available credits. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A system, comprising:
-
a processor; a main memory; processor buffers included in the processor; an operating system scheduler executed by the processor to perform operations, the operations comprising; setting credits in the processor buffers for a plurality of threads executed by the processor wherein the credits for a thread comprise a number of credits, wherein a thread having credits can be selected for execution and wherein a thread having no credits is not selected for execution; and configuring the processor to execute the threads; allocating addresses in the main memory to the processor for the processor to use as virtual processor buffers to store status and the thread credits for designated threads, wherein the processor buffers for a first set of threads are maintained in the virtual processor buffers and the processor buffers for a second set of threads are maintained in the processor; and code executed by the processor to perform operations, the operations comprising; determining threads whose status and credits are in the processor buffers to swap to virtual processor buffers and the status and credits of threads in the virtual processor buffer to swap to the processor buffers, wherein the threads to swap to the virtual processor buffers from the processor buffers have no credits or are in a paused state; alternating among executing the threads having available credits; decrementing the credits available for one of the threads to reduce the number of available credits for the thread in response to executing the thread; setting a replenish flag for a replenish thread to indicate that the replenish thread will not execute until all the other threads have no available credits; and initiating by the replenish thread an operation to reassign credits to the threads in response to the plurality of the threads other than the replenish thread having no available credits. - View Dependent Claims (8, 9, 10)
-
-
11. A method, comprising:
-
setting credits for a plurality of threads in processor buffers executed by a processor, wherein the credits for a thread comprise a number of credits, wherein a thread having credits can be selected for execution and wherein a thread having no credits is not selected for execution; configuring, by an operating system scheduler, the processor to execute the threads and set the thread credits; allocating, by the operating system scheduler, main memory addresses to the processor for the processor to use as virtual processor buffers to store status and the thread credits for designated threads, wherein the processor buffers for a first set of threads are maintained in the virtual processor buffers and the processor buffers for a second set of threads are maintained in the processor; determining threads whose status and credits are in the processor buffers to swap to virtual processor buffers and the status and credits of threads in the virtual processor buffer to swap to the processor buffers, wherein the threads to swap to the virtual processor buffers from the processor buffers have no credits or are in a paused state; alternating, by the processor, among executing the threads having available credits; decrementing, by the processor, the credits available for one of the threads to reduce the number of available credits for the thread in response to executing the thread; setting, by the processor, a replenish flag for a replenish thread to indicate that the replenish thread will not execute until all the other threads have no available credits; and initiating an operation, by the processor, to execute a replenish thread to reassign credits to the threads in response to the plurality of the threads other than the replenish thread having no available credits. - View Dependent Claims (12, 13, 14)
-
Specification