KDOC 279: パイプのバッファはいっぱいになるとwriteをブロックする
この文書のステータス
- 作成
- 2024-11-09 貴島
- レビュー
- 2024-11-14 貴島
概要
パイプのバッファはいっぱいになるとwriteをブロックする。マニュアルの該当箇所を示す。
man "pipe(7)" | grep -A 7 "Pipe capacity"
Pipe capacity
A pipe has a limited capacity. If the pipe is full, then a write(2)
will block or fail, depending on whether the O_NONBLOCK flag is set
(see below). Different implementations have different limits for the
pipe capacity. Applications should not rely on a particular capacity:
an application should be designed so that a reading process consumes
data as soon as it is available, so that a writing process does not re‐
main blocked.
関連
抽象。
- 上限のある中継地点が満杯になると、送り手を待たせる
関連。
- 具体例: KDOC 254: ジョブプロセスは標準エラー出力が詰まってSleepしていた。満杯の受け渡し口で書き手が待たされる、同じ現象の実例
- 具体例: KDOC 260: プロセスがSleepになるのを再現する。満杯の受け渡し口で詰まる現象を再現しようとした例
- 動機: KDOC 278: パイプはバッファがいっぱいになると処理をブロックする。マニュアルの通りか挙動を確かめた