← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 4545.g.3.b

通道缓冲只提供有限排队

理解等级:中级

有缓冲通道保存固定容量的待接收值。缓冲未满时发送可先完成,缓冲为空时接收等待;满后发送同样会阻塞。缓冲让生产与消费短暂脱开,但不会提高消费者本身的处理能力;容量消耗和背压仍需纳入生命周期设计。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Go Language Foundations · 查看原书依据

      Sends to a buffered channel only block when the buffer is full; receives from a channel only block when the buffer is empty. Any other time, send and receive operations write to or read from the buffer, respectively, and exit immediately. A buffered channel can be created by providing a second argument to the make

    参考来源

    - 位置:《Cloud Native Go》第03章《Go Language Foundations》(来源项目book-sources;源文件:extracted/Cloud Native Go (Matthew A. Titmus)/_epub-src/OEBPS/ch03.xhtml) - 结论依据:有缓冲通道保存固定容量的待接收值。原文相应定义、示例或限制为此结论提供依据;补充纠错与版本边界在正文就近标明。 - 原始内容:Sends to a buffered channel only block when the buffer is full; receives from a channel only block when the buffer is empty. Any other time, send and receive operations write to or read from the buffer, respectively, and exit immediately. A buffered channel can be created by providing a second argument to the make