Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Suppose that in responding to interrupts from I/O deviceA the processor consumes

ID: 3818616 • 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) 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

So, the processor polls 2000 times per second for every 0.5ns

It takes 500 cycles for each polling attempt. So, it takes 1000,000 cycles to generate request at Device B.

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

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote