On 2012/2/17 10:42, David Xu wrote:
aybe following code can check to see if TSC-LOW works by let the thread run
on each cpu.


refresh:

gettimeofday(&prev, NULL);
int cpu = 0;
for (;;) {
     cpuset_t set;
     cpu = ++cpu % 4;
     CPU_ZERO(&set);
     CPU_SET(cpu, &set);
     pthread_setaffinity_np(pthread_self(), sizeof(set), &set);
     gettimeofday(&cur, NULL);
     if ( timercmp(&prev, &cur, >)) {
        abort();
   }
   prev = cur;
}

_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[email protected]"

Reply via email to