Displaying 1 result from an estimated 1 matches for "clock_getcpuclockid".
2009 Oct 23
3
rdtsc in userspace
...ses of rdtsc, I found that glibc has its
own implementation of clock_gettime that uses rdtsc
directly!
The manpage for clock_gettime ("man 3 clock_gettime")
has a lengthy caveat about using clock_gettime on
an SMP system BUT provides a mechanism to test to
see if your SMP system is safe, clock_getcpuclockid(0).
See for example (near the end):
http://linux.die.net/man/3/clock_gettime
But testing this on a system I know is unsafe, the
test says my system is safe! Looking at the source
code, I can see why... the test is a compile-time
test, not a run-time test, and on x86 it appears that
it will alway...