Operating system I/O management: 4. Buffer management (single buffer, double buffer, circular buffer, buffer pool)

mind Mapping

Insert picture description here

What is a buffer

Insert picture description here

Buffer function

Insert picture description here

Single buffer

Insert picture description here

How long does it take to calculate the average processing time for each piece of data?
1. T>C
Insert picture description here
2. T<C
Insert picture description here
3. Conclusion
Insert picture description here

Double buffering

1. T>C+M
Insert picture description here
2. T<C+M
Insert picture description here
3. Conclusion:
Insert picture description here

Circular buffer

Insert picture description here

Buffer pool

Insert picture description here

Essentially, the buffers are put together, and the buffers are classified according to the type of request

1. The input process requests input data

Insert picture description here

Empty------hin-------Enter the end of the queue

2. The calculation process wants to obtain a piece of input data

Insert picture description here

Full------sin------empty tail

3. The calculation process wants to flush the prepared data into the buffer

Insert picture description here

Empty------hout-------output tail

4. The output process requests output data

Insert picture description here

Full-------sout------empty

Guess you like

Origin blog.csdn.net/qq_41587740/article/details/109081371