A certain processor consumes 1000 cycles to perform the context switch required to transfer control to the interrupt handler for an I/O device that triggers an interrupt. 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 back to the program that was running. The processor’s clock rate is 3 GHz.
a) (5) What is the maximum number of requests per second that a device can generate without causing the system to loose data?
b) (5) Suppose that instead of using interrupts, a program running on the same processor polls some other device (DeviceB) for requests. Assume that each polling operation takes 150 nano-seconds. If deviceB generates 2 million requests per second and no other I/O is performed, what is the maximum time that could be taken to service the device to avoid losing data?
//do comment if any clarification needed
T1 = Time required for 1 complete request of an interrupt = 1000 + 10000 + 1000 = 12000 cycles
C = Clock rate of processor = 3 GHz = 3 x 109 cycles per second
a)
maximum number of requests per second without loosing data = C/T1 = 3 x 109 / 12000 = 2.5 x 105
ie 2.5 lakh requests can be serviced in one second.
b)
Time for 1 poll operation = 150 ns
Total polls for single device in one second = 2 million = 2 x 106
Total time for single device in one second to avoid data loss = 2 x 106 x 150 = .3 seconds
Get Answers For Free
Most questions answered within 1 hours.