Patent ID: 8209698

Claim:
A method of accounting for processor time usage in a processor core having a single-threaded mode of operation and a multi-threaded mode of operation, the method comprising: determining whether or not the processor core is in the single-threaded mode; at periodic intervals, determining increments to be applied to resource usage counter circuits within the processor core according to amounts of usage of internal resources of the processor core by a plurality of threads executing within the processor core, each of the threads corresponding to one of the resource usage counter circuits, wherein, in response to determining that the processor core is in the single-threaded mode, the increments are determined such that each processor cycle is attributed to a single thread executing within the processor core; at the end of the periodic interval, incrementing the resource usage counter circuits by the increments determined by the determining, wherein the counter circuits are incremented by different values according to differences in the amounts of usage of the internal resources of the processor core by their corresponding threads; apportioning the processor time usage over a timebase cycle to respective threads of the plurality of threads in proportion to values contained in the resource usage counter circuits at the ends of the periodic intervals, wherein threads of the plurality of threads that use more of the resources are accounted a higher amount of the processor time usage.