Patent ID: 8521993

Claim:
An apparatus comprising: a processor including a pipeline adapted to be shared by at least a first and a second processing element, wherein the processor comprises: detection logic adapted to detect a blocking stall, which is to be associated with the first processing element, in a subsequent stage of the pipeline; and a counter coupled to the detection logic, the counter being adapted to be updated in a first direction away from a default value for each cycle of the blocking stall; a resource storage area coupled to the detection logic, the resource storage area being adapted to hold, in response to the blocking stall being associated with the first processing element, a second resource value to indicate the second processing element is to be selected; and selection logic coupled to the counter and the resource storage area, the selection logic being adapted to select the second processing element for a preceding stage of the pipeline based on the resource storage area holding the second resource value and the counter not holding the default value, wherein the counter is further adapted to be updated in a second direction towards the default value for each cycle that the selection logic selects the second processing element, wherein the detection logic is further adapted to detect a subsequent blocking stall associated with the second processing element, and wherein: for each cycle of the subsequent blocking stall that the counter does not include the default value and the resource storage area holds the second resource value, the counter is updated in the second direction towards the default value and the resource storage area is to continue holding the second resource value, for a cycle of the subsequent blocking stall that the counter does include the default value, the counter is to be updated in the first direction and the resource storage area is to be updated to hold the first resource value to indicate the first processing element is to be selected, and for each cycle of the subsequent blocking stall that the counter does not include the default value and the resource field holds the first resource value to indicate the first processing element is to be selected, the counter is updated in the first direction and the resource storage area is to continue to hold the first resource value.