[net.general] CS Qualifier Questions on Buffering

ijk@hou5e.UUCP (10/18/83)

The following are  questions from a recent PhD qualifying exams that
I am having difficulty in answering.  I'm interested if anyone 
could add something to my analysis.

1). "A job to be run consists of inputting and processing a sequence of
records: R1, R2, R3, ...
Each odd-numbered record takes two units of time to input, and one unit
of time to process.
Each even-numbered recors takes one unit of time to input and two units
of time to process.

a). What is the maximum number of input buffers which can beneficially
be used?
	Justify your answer by
b) Drawing a timing diagram to show processor and input-device utilization
for the number of buffers in your answer to part a.
c). Drawing timing diagrams to show processor and input-device utilization
for each smaller number of buffers, and explaining how the diagram
suggests that more buffers may be more beneficial.

2). a) In a multiple-input buffer system what is the criterion for
deciding how many buffers to use, i.e., for any integer N, how do we tell
if N+1 buffers would be better than N buffers?
b) A job to be run consists of inputting and processing a sequence of
records: R1, R2,... Each odd-numbered record takes two units of time to
input, and three time units to process.  What is the optimum value of N
for this job?  Justify your answer in terms of criterion in question a.

	I have a hard time understanding what the problem is, especially
with fixed rates input & fixed processing times (obviously, for variable
rates, we get into queuing theory, but that's not the issue).  Unless
you have multiple I/O channels, the best performance is with TWO buffers
(usually), since the CPU processes one record while the I/O channel reads 
in the other. More buffers would be useful only if one type of a record
take very long to process, and all the others took a short time to process.
Then, you would want read a sufficient number of records to make sure the
processor would have something to do when it finished the number. 
(The number of buffers would then equal 1 + [longest time for CPU to
process a recors / shortest time for I/O to read in a record: rounded
up]).

	It seems to trivial to be on a qualifier, but it must be important
since these two questions came in different years.  Am I missing something?

Ihor Kinal
AT&TIS, Holmdel NJ
hou5e!ijk (talks to most Holmdel Bell Labs machines, ariel, ho* )
Thanx in advance.