News for hackers. Stuff that matters.
Re:The slow currentTimeMillis() by amelius on Friday August 04, 2017 @09:50AM (#14928612)
> Some background thread regularly updates three double-words there, which contain the high part of the value, the low part, and the high part again.

So to implement a clock, they are using a different thread that updates a counter every millisecond or so? Isn't this a bit inefficient?

Re:The slow currentTimeMillis() by bonzini on Friday August 04, 2017 @10:31AM (#14928911)
It's not a thread, it's an interrupt handler. Windows (on x86) uses the real-time clock's periodic timer, which can be made to tick at any power-of-two frequency between 1 Hz and 32768 Hz.
Re:The slow currentTimeMillis() by amelius on Friday August 04, 2017 @10:40AM (#14928972)
Is that interrupt handler installed for every process that needs the timer? Or is there only one handler globally?
Re:The slow currentTimeMillis() by avdicius on Friday August 04, 2017 @12:19PM (#14929799)
It's a hardware interrupt from a hardware clock that is handled by the OS kernel. Regular user processes are usually totally forbidden from touching that hardware stuff.