Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Pipe?

Definition 14.7 University Computer Science — Year 2 · Capítulo 14 — Files, Pipes and Signals

A pipe is a kernel buffer with two ends, created by pipe(fd): bytes written to the write end fd[1] are read, in the same order, from the read end fd[0]. A read on an empty pipe waits; a write to a full pipe waits; on Linux a pipe holds 65 536 bytes, and a write of at most 4096 bytes is never mixed with another writer’s. A read returns 0, end of file, when the pipe is empty and no write end is open anywhere.

A pipe before and after the wiring. Right after the fork, both processes hold both ends. Each then keeps one: the writer’s descriptor 1 and the reader’s descriptor 0 become the ends, and every other copy is closed, so that the reader sees end of file when the writer is done.
A pipe before and after the wiring. Right after the fork, both processes hold both ends. Each then keeps one: the writer’s descriptor 1 and the reader’s descriptor 0 become the ends, and every other copy is closed, so that the reader sees end of file when the writer is done.
Leer en el capítulo →