3 ms·
How does rdtsc behave in the presence of multiple cores? As in: first time sample is taken on core P, process is pre-empted, then picked up again by core Q, sec
by elteto 1y ago
How does rdtsc behave in the presence of multiple cores? As in: first time sample is taken on core P, process is pre-empted, then picked up again by core Q, second time sample is taken on core Q. Assume x64 Intel/AMD etc.
- khold_stare 1y agoIn trading all threads are pinned to a core, so that scenario doesn't happen.
- foobar10000 1y agoYeap! Also - all modern systems in active use have invariant tsc. So even for migrating threads - one is ok.
- elteto 1y agoYou could still have a receiving thread and a sending thread for example, so it’s not as simple. But googling suggests that if the CPU has the invariant_tsc flag then it’s not a problem, as foobar mentions.