This preview shows page 1. Sign up to view the full content.
Unformatted text preview: times to determine the approximate number of clock ticks per second. Try compiling the program and running it on multiple systems. Try to ﬁnd two different systems that produce results that differ by at least a factor of two. 9.9. SUMMARY
Homework Problem 9.11 [Category 1]: 483 We can use the cycle counter to generate activity traces such as was shown in Figures 9.3 and 9.5. Use the functions start counter and get counter to write a function:
#include "clock.h" int inactiveduration(int thresh);
Returns: Number of inactive cycles This function continually checks the cycle counter and detects when two successive readings differ by more than thresh cycles, an indication that the process has been inactive. Return the duration (in clock cycles) of that inactive period. Homework Problem 9.12 [Category 1]: Suppose we call function mhz (Figure 9.10) with parameter sleeptime equal to 2. The system has a 10 ms timer interval. Assume that sleep is implemented as follows. The processor maintains...
View Full Document