liveBook · Manning

Named pipe

As explained in Grokking Concurrency

A named pipe is a pipe identified by a system-visible name that enables data transfer between processes on the same computer or across a network.

Imagine putting a rubber duck into one end of a waterway and watching it emerge at the other. A pipe moves data in much the same way: a writer sends it, and a reader receives it. A named pipe gives that route a system-visible name, so processes can use it to transfer data on the same computer or across a network. section 5.3 section 5.6

Named pipes transfer data in first-in, first-out order: requests are processed in the order they arrive. That is why they are also called FIFOs. Unlike an unnamed pipe, which relies on related tasks sharing file descriptors, a named pipe offers a simple interface for communication between processes. section 5.3 section 5.6

A useful contrast

A Python multiprocessing.Pipe example passes a “Rubber duck” message from a writing thread to a reading thread. It demonstrates the writer-and-reader pattern, but it creates an unnamed pipe—not a named-pipe implementation. section 5.3

Choose the mechanism to fit the communication problem. Pipes suit synchronous producer–consumer communication; message queues support asynchronous exchange, while sockets offer a two-way channel through a different interface. section 5.6

How Grokking Concurrency covers it

How deep it goes
Defines FIFO ordering and contrasts named with unnamed pipes, but does not provide named-pipe implementation steps.
Examples
Uses a rubber-duck waterway analogy and a Python unnamed-pipe sender-and-receiver example; gives no named-pipe code example.
What it assumes
Introduces writer and reader ends through an analogy and defines FIFO before comparing named and unnamed pipes.
What you can do after
Evaluate/understand named pipes as an option for ordered transfer between processes alongside other IPC mechanisms.
How it connects
Connects named pipes to interprocess communication, unnamed pipes, producer–consumer communication, message queues, and sockets.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Concurrency. The section links point to the parts of the book it draws on.