23 ms·
> 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 imp
by amelius 9y ago
> 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?
- bonzini 9y agoIt'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.
- amelius 9y agoIs that interrupt handler installed for every process that needs the timer? Or is there only one handler globally?
- avdicius 9y agoIt'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.