Maintaining a system clock that can be read by any user program requires only th
ID: 1921523 • Letter: M
Question
Maintaining a system clock that can be read by any user program requires only that the operating system read a physical device (keeping physical time) and then write the time into a globally readable variable. Suppose the time to read thee physical clock and to update the variable is 100 microseconds. What percentage of the total CPU time is spent maintaining a clock that is accurate to the millisecond resolution (that is, the clock always reflects the correct time to the closest millisecond). The 100 microsecond resolution? The 10 microsecond resolution? Explain your rationale.Explanation / Answer
If you want a clock accurate to 1 millisecond, you have to update the variable at least once every millisecond. If you do that, the CPU utilization is 10% to maintain the clock. If you want the clock resolution of 100uS, you'll spend 100% of the CPU time and will not be able to do anything else. A 10uS resolution is impossible to achieve with this set of input variables.
In a case like this, it makes sense to use DMA and update the memory location without any CPU intervention.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.