Re: [Algorithms] Timing problems
Brought to you by:
vexxed72
From: Jon W. <jw...@gm...> - 2009-01-05 21:52:34
|
Paul at Home wrote: > I've just fallen foul of QPC not working correctly having just gone > from a single processor to a quad core. > > I remember reading somewhere that multiple processors could cause > problems in the future, but I guess the future (for me) just arrived. > I do handle the well-known "jump" problem but I guess that's old news > now anyway. > > Can anyone point me in the right direction for how to fix this please ? There are two fixes: 1) Keep the last value returned, and return max(lastValue, nextValue). Requires some degree of locking or compare/exchange to work in a multi-threaded fashion, or using TLS for the "lastValue". 2) Install proper CPU drivers for your system so you don't get incoherent results. <-- vastly preferred method Sincerely, jw |