Patent ID: 8640133

Claim:
A method of scheduling fetch operations to a plurality of threads scheduled to run in a simultaneous multithreading processor, wherein a plurality of fetch operations is performed in a given fetch cycle in a plurality of fetch cycles within a given sub-context switch interval, the method comprising: determining a software/OS priority for each thread in the plurality of threads; dividing each context switch interval in a plurality of context switch intervals into a plurality of sub-context switch intervals of equal length, each sub-context switch interval having a same number of fetch cycles and each fetch cycle having a same number of fetch operations; and attributing a desired number of fetch operations to each thread in the plurality of threads per each sub-context switch interval based on the determined software/OS priority of each thread, wherein during each sub-context switch interval: assigning each of the plurality of fetch operations to each of the plurality of threads during each fetch cycle within a sub-context switch interval based on one of a thread software/OS priority sorting algorithm or a thread hardware performance priority sorting algorithm, wherein the thread software/OS priority sorting algorithm sorts the plurality of threads according their respective software/OS priority level, and wherein the thread software/OS priority sorting algorithm is a default sorting algorithm; calculating an error value based on a difference between the desired number of fetch operations attributed to each of the plurality of threads per each sub-context switch interval and an actual number of fetch operations performed by each of the plurality of threads per each sub-context switch interval; comparing the calculated error value with a predetermined error threshold value after a defined warm up period of a predetermined number of sub-context intervals has expired; and responsive to the calculated error value exceeding the predetermined error threshold value, switching to whichever of said two sorting algorithms that is not presently being used for a following sub-context switch interval, wherein during the defined warm up period of the predetermined number of sub-context intervals the thread software/OS priority sorting algorithm is used regardless of the calculated error value and no switching of said two sorting algorithms takes place.