[fpc-pascal] EpikTimer v1.0.1 released

Henry Vermaak henry.vermaak at gmail.com
Wed May 28 18:09:44 CEST 2014


On Wed, May 28, 2014 at 04:31:53PM +0200, Michael Schnell wrote:
> On 05/28/2014 04:26 PM, Henry Vermaak wrote:
> >
> >- The rdtsc instruction needs to be protected from out of order
> >   execution.  Some people use cpuid, which is expensive.  It looks like
> >   the linux kernel uses mfence or lfence/mfence depending on CPU type.
> >
> 
> ... meaning the current version of incorrect ?!?!?

Indeed.  What's worse is that it _always_ uses the TSC on x86, without
knowing whether it's actually a reliable clock source for the particular
hardware configuration.

I can only recommend to never use this component, just use an ifdef to
call QueryPerformanceCounter/()clock_gettime() based on OS.

> Things like this is why I'd rather use dVSO.

Calling the vDSO will certainly make things faster.  I don't know what
the overhead of QueryPerformanceCounter() is.

Henry



More information about the fpc-pascal mailing list