Patent ID: 7631308

Claim:
A computer-implemented method in a simultaneous multi-threading microprocessor that executes multiple threads concurrently during each clock cycle, said computer-implemented method comprising: assigning a clock cycle priority to a first thread and to a second thread during a standard selection state that lasts for an expected number of clock cycles, said clock cycle priority assignment being temporary and designed to change automatically after said expected number of clock cycles have been executed; assigning said clock cycle priority according to a standard selection definition during said standard selection state by selecting said first thread to be a primary thread and selecting said second thread to be a secondary thread for processing during said standard selection state; using said clock cycle priority to determine which thread to dispatch with first priority during a current clock cycle; using said clock cycle priority to determine which thread to issue with the first priority during said current clock cycle; assigning said clock cycle priority by storing an identifier that identifies said primary thread in a clock cycle priority assignment register; during each clock cycle, identifying a thread that is assigned to be said primary thread by reading current contents of said clock cycle priority assignment register, a thread that is identified by said identifier being temporarily assigned as said primary thread and temporarily assigning a thread that is un-identified by said identifier as said secondary thread; determining whether a condition exists that requires overriding said standard selection definition, wherein said condition comprises the first thread having a same priority level as the second thread, wherein the first thread is selected as the primary thread and said first thread cannot dispatch or wherein said condition comprises the first thread having a different priority level than the second thread, wherein the second thread is selected as the secondary thread and the second thread cannot dispatch; in response to determining that said condition exists that requires overriding said standard selection definition, executing an override state, during which said standard selection definition is overridden by selecting said second thread to be said primary thread and selecting said first thread to be said secondary thread for processing; forcing said override state to be executed for an override period of time, said override period of time equaling said expected number of clock cycles plus a forced number of clock cycles; granting said forced number of clock cycles to said first thread in response to said first thread again becoming said primary thread; and granting resources from a resource pool to said primary thread before granting resources to said secondary thread from any resources of said resource pool that remain after granting said resources to said primary thread.