News for hackers. Stuff that matters.
Re:The slow currentTimeMillis() by Const-me on Friday August 04, 2017 @10:09AM (#14928755)
> why the TSC isn't used

Because on most modern CPUs, clock frequency is extremely unstable: Turbo Boost, SpeedStep, Cool'n'Quiet, etc. These features make TSC not suitable for time measures.

Re:The slow currentTimeMillis() by bitcharmer on Friday August 04, 2017 @10:22AM (#14928845)
Please check for what features like constant_tsc or nonstop_tsc are for before spreading misinformation
Re:The slow currentTimeMillis() by Const-me on Friday August 04, 2017 @10:47AM (#14929029)
That thing is intel-only, or at least Linux kernel thinks so: https://github.com/torvalds/linux/blob/master/arch/x86/kerne...

And even on Intel, TSC is not reliable: https://lwn.net/Articles/388286/

Re:The slow currentTimeMillis() by makomk on Friday August 04, 2017 @12:09PM (#14929728)
AMD CPUs have supported constant_tsc and nonstop_tsc since the Phenom era too.
Re:The slow currentTimeMillis() by duskwuff on Friday August 04, 2017 @04:15PM (#14931833)
There have also been some multi-socket configurations where TSC will gradually become desynchronized across sockets.
Re:The slow currentTimeMillis() by otterley on Friday August 04, 2017 @09:31PM (#14933751)
That lkml thread was back in 2010, before invariant TSC was a thing.
Re:The slow currentTimeMillis() by yjftsjthsd-h on Friday August 04, 2017 @02:11PM (#14930641)
> intel-only

So... >99% of servers and the vast majority of desktops?

Re:The slow currentTimeMillis() by loeg on Friday August 04, 2017 @10:48AM (#14929040)
This is covered in the fine article.
Re:The slow currentTimeMillis() by fulafel on Friday August 04, 2017 @10:32AM (#14928918)
On modern CPUs the tsc does not count CPU cycles.