Question: When the time to produce a data item, P, is equal to the time to consume the data item, C, then buffer swapping with 2
When the time to produce a data item, P, is equal to the time to consume the data item, C, then buffer swapping with 2 buffers keeps both the consumer and the producer busy at all times. The numbers in the diagram indicate which buffer is being used.
| Producer | 1 | 2 | 1 | 2 | 1 | 2 |
|---|---|---|---|---|---|---|
| Consumer | 1 | 2 | 1 | 2 | 1 |
(a) If the time to consume is longer than the time to produce, then multiple concurrent consumers can be used to keep the producer busy at all times. Determine the number of concurrent consumers and the number of buffers needed when C = 2P and show the corresponding timing diagram.
(b) Determine the number of consumers necessary to keep the producer busy for the general case when C is a multiple of P.
(C) Determine the number of consumers necessary to keep the producer busy when C is less than P.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
