> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monad.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# 流水线化

*流水线化* 是一种通过将任务划分为一系列可并行处理的更小任务来实现并行的技术。

流水线化用于计算机处理器,以在相同时钟频率下提高顺序执行一系列指令的吞吐量。(处理器中还使用其他技术来提高吞吐量。) 有关指令级并行 (ILP) 的更多信息,请参阅[此处](https://en.wikipedia.org/wiki/Instruction_pipelining)。

流水线化的一个简单示例:

<img src="https://mintcdn.com/monadfoundation-40611fb6/-TCPhWHMfGzx9j3a/static/img/pipelining.png?fit=max&auto=format&n=-TCPhWHMfGzx9j3a&q=85&s=7ba514b41392cbdfdf58d91313a607a7" alt="Pipelining, Laundry Day" style={{marginLeft: "auto", marginRight: "auto"}} width="529" height="499" data-path="static/img/pipelining.png" />

<p style={{textAlign: "center", fontSize: "0.875rem", opacity: 0.65,marginTop: "0.5rem", fontStyle: "italic"}}>流水线化洗衣日。上:朴素方案;下:流水线方案。图片来源:<a href="https://www.cs.fsu.edu/~hawkes/cda3101lects/chap6/index.html?$$$F6.1.html$$$">Prof. Lois Hawkes, FSU</a></p>

当洗四批衣物时,朴素策略是先完成第一批的洗涤、烘干、折叠和存放,然后再开始处理第二批。流水线策略则是在第一批进入烘干机时就开始洗涤第二批。流水线化通过同时利用多种资源,更高效地完成工作。
