Jump to content
Urch Forums

From Schaum's OS (6)


wood

Recommended Posts

7.6 A serial line can receive input at a maximum rate of 50,000 bytes per second. The average input rate is 20,000 bytes per second. If input is handled using polling, the polling routine takes 3 microseconds to execute, wheter or not an input byte is present. Bytes not retrieved from the controller before the next byte arrives are lost. What is the maximum safe polling interval?

 

7.7 Given the system in the previous problem, assume the input handling was changed to interrupt I/O with an interrupt routine that took 3 microseconds to execute. How much would interrupts decrease the amount of time spent processing the input?

Link to comment
Share on other sites

Hi wood.

 

I'm not sure I understood the question, but I'll give it a try...

 

We need to have the polling in the highest burst rate.

Maximum rate: 50,000 bytes - thus we need to poll every 20ns. Since polling takes 3ns, the interval between pollings is 17ns.

 

Portion of time spent in polling is 3/20 = 15% (3ns on every 20ns)

Portion of time spent if Interrupt I/O is in use: 3/50 = 6% (3ns on average of 50ns == 20,000 bytes per second).

 

Rafi

Link to comment
Share on other sites

Rafi, your right on the first question (7.6). The maximum safe polling interval is indeed 17 microseconds (note: it is not "ns", it is "mu-s" (10^-6), but I can't represent that greek letter here. ns is nanoseconds (10^-9).

 

I believe you're right on the second one as well, even though you didn't clearly state the answer. The answer is that the overhead using interrupts would be 40% of that using polling.

 

Good job!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...