41.8k views
5 votes
A typical printed page of text contains 50 lines of 80 characters each. Imagine that a certain printer can print 6 pages per minute and that the time to write a character to the printer’s output register is so short it can be ignored. Does it make sense to run this printer using interrupt‐driven I/O if each printer requires an interrupt that takes 50 µsec all‐in to service?

User Mcfedr
by
8.1k points

1 Answer

7 votes

Solution :

Given

The number of line that can be written by printer per page = 50 lines

The number of characters that can be written by printer per page = 80 characters.

Number of pages that can be written per minute = 6 pages

The speed for writing characters to the printer can be found by

= 50 x 80 x 6

= 400 characters per sec

In one second the printer has the writing speed of 400 character.

Now each of the character uses = 50 µsec of the CPU time for interrupt.

So in each second, the interrupt overhead = 20 msec

Now using the interrupt driven input/output, 980 msec time can be available for other work.

Thus, the interrupt overhead charges only 2 percent of the CPU, that will hardly affect the program to run.

User Chrugel
by
7.3k points