I wonder how many people need milliseconds in time stamps because they need the real sub second time or if they record milliseconds because they need the happens-before history. They are different problems. The latter can be solved with an atomic counter at a much faster rate.
Why do you say atomic counter is faster? It might be for low contention but it likely scales worse. ns-resolution timestamp is cheap on modern systems.
-
-
How so? Gettimeofday() takes 40ns.
-
40ns on one thread is small compared to serializing cache/memory accesses on a moderate to large number of cores.
-
Not really no. It can’t keep up with my serialization that is 5ns.
-
Are you sure yours works? 5ns seems really low, and it sounds like you're only measuring the latency of the atomic inc on the calling thread, not the stalls it may impose on other cores.
-
I’m talking about my serialization code. I don’t want a timestamps call to kill my perf by a factor of 8x.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.