On Tue, 1 Jun 2010 15:29:05 +0100
Sad Clouds <[email protected]> wrote:

> A better way would be for cpu to have its own counter, which is
> incremented until it reaches a certain threshold. At the threshold, the
> global counter is incremented by the local counter.
> 
> It all depends on the logic of what the counter is supposed to do. But
> it doesn't have to be very expensive, i.e. if it's just a statistics
> counter, you can do the above trick to reduce contention.

Another way would be for the cpu+global values to only be assembled
when statistics are requested, unless there's active code taking that
global counter into consideration frequently.
-- 
Matt

Reply via email to