First of all, notice that you are potentially doing a lot of unnecessary work when the buffer runs out, since you are processing two buffers for each loop iteration.
首先注意,当缓冲区用尽时,可能要做许多不必要的工作,因为对于每个循环迭代都要处理两个缓冲区。
3
The potential sources of branching are determining whether a buffer should be marked as "filling," as well as polling the buffers to find out which ones are available.