1. A method comprising: determining a number of active threads being executed by a multi-threaded processor; assigning, to each active thread of a plurality of active threads, a separate cache unit of a plurality of cache units when the number of active threads is equal to a maximum number of active threads supported by the multi-threaded processor, wherein the plurality of cache units are concurrently accessible by the multi-threaded processor; assigning, to an active thread of one or more active threads, more than one cache unit of the plurality of cache units when the number of active threads is less than the maximum number of active threads; storing a mask for each active thread to indicate which one or more cache units of the plurality of cache units are assigned to that active thread; receiving a request for data for an active thread; determining which one or more tag ways are associated with the one or more cache units assigned to the active thread for which the request was received based on the mask stored for the active thread for which the request was received; retrieving tags stored in the one or more tag ways indicated by the mask stored for the active thread for which the request was received; determining which cache unit of the one or more cache units assigned to the active thread is to provide the data requested by the active thread based on the retrieved tags; and providing the data from the determined cache unit.