CS631 -- Advanced Programming in the UNIX Environment

Pipes Exercise: How do multiple readers/writers behave?

We know that a pipe(2) can have multiple readers or writers, and that PIPE_BUF-sized chunks are not interleaved, but what does that look like in practice?

Write a program that uses a pipe(2), then forks multiple times. Create multiple readers and multiple writers, and observe how data flows through the pipe.


[Course Website]