Patent ID: 8108872

Claim:
A method for allocating a shared resource in a multithreaded processor that concurrently executes a plurality of threads, each thread being of one of a plurality of thread types, the method comprising: reserving a first amount and a second amount of a shared resource, respectively, for allocation to threads of a first one and a second one of the plurality of thread types, wherein the first amount and the second amount are reserved by dividing the shared resource such that the first amount is reserved for allocation to threads of the first thread type and a remainder of the shared resource is reserved as the second amount for allocation to threads of the second thread type; tracking, for each of the first and second thread types, an amount of the shared resource currently allocated to threads of that type; receiving a request to allocate a first target amount of the shared resource to a first new thread, the first new thread being of the first thread type; determining, based at least in part on the first reserved amount and the amount of the shared resource currently allocated to threads of the first thread type, whether the first target amount of the shared resource is available for allocation to the first new thread; and in the event that the first target amount of the shared resource is available, allocating the first target amount of the shared resource to the first new thread, wherein the act of reserving the first amount and the second amount of the shared resource includes: partitioning the shared resource into at least a first section associated with the first thread type and a second section associated with the second thread type; and wherein the act of determining whether the first target amount of the shared resource is available for allocation to the first new thread includes determining whether the first target amount of the shared resource is available within the first section, and wherein the act of allocating the first target amount includes allocating the first target amount of the shared resource from the first section in a circular FIFO fashion.