Patent ID: 8495643

Claim:
A method of processing a workload in a multithreaded processor of the type that includes a plurality of hardware threads, each of the plurality of hardware threads configured to receive at least one message carrying data to process the workload through a respective inbox from among a plurality of inboxes, the method comprising: receiving a plurality of messages at a first inbox among the plurality of inboxes, wherein the first inbox is associated with a respective first hardware thread among the plurality of hardware threads, and wherein each of the plurality of messages includes a priority associated therewith; and alternating between selecting messages based on time stamp and selecting messages based on priority, including: from the plurality of received messages, and while selecting messages based on priority, selecting a first message among the plurality of received messages to process in the first hardware thread based on the first message being associated with a highest priority among the plurality of received messages; in response to processing the first message, switching from selecting messages based on priority to selecting messages based on time stamp; after selecting the first message, and while selecting messages based on time stamp, selecting a second message among the plurality of messages to process in the first hardware thread based on the second message being associated with an earliest time stamp among the plurality of received messages; in response to processing the second message, switching from selecting messages based on time stamp to selecting messages based on priority; and after selecting the second message, and while selecting messages based on priority, selecting a third message among the plurality of received messages to process in the first hardware thread based on the third message being associated with a highest priority among the plurality of received messages.