Suppose that in responding to interrupts from I/O deviceA the processor consumes
ID: 3813718 • Letter: S
Question
Suppose that in responding to interrupts from I/O deviceA the processor consumes 1000 cycles to perform the context switch required to transfer control to the interrupt handler. The interrupt handler takes an additional 10,000 cycles to service the device request. Once the interrupt processing is complete, another 1000 cycles are required to perform the context switch required to return from the interrupt handler and resume the program that was running. The processor’s cycle time is 0.5 nano-seconds.
a) What is the maximum rate at which DeviceA can generate requests without causing the system to loose data?
b) Suppose that a program running on the same processor polls some other device (DeviceB) for requests. If each polling operation takes 150 nano-seconds, what is the maximum time that could be taken to service the device if the loss of data is to be avoided and the device generates 2 million requests per second?
Explanation / Answer
Number of cycles to perform context switch = 1000
Number of cycles to perform context switch required to return from interrupt handler and resume the program that was running = 1000
Total number of cycles = 1000+1000 = 2000
Processor cycle time = 0.5ns
a.
So, the processor polls 2000 times per second for every 0.5ns
b.
It takes 500 cycles for each polling attempt. So, it takes 1000,000 cycles to generate request at Device A.
It means each polling attempt takes 500 cycles, so it spends 1000,000 cycles per second polling. In 150 of polling attempts, a request is waiting from the I/O device each of which takes 10, 000 cycles to complete, for another 1,50,000 cycles total.
Therefore, total time spent on I/O each second is 2,500000 cycles
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.