Why you should use ZZ instead of pipes in your next project

Why you might prefer pipes

Why ZZ is more efficient than pipes

This is how a pipe works. Data is copied once into kernel space, and once out of kernel space. There will be two copies of the same data.

This is how ZZ works. Data is never copied, and there are no duplicates of a buffer.

What is the story behind ZZ?

The main author, Tom Weber, was fed up with the situation of the Unix environment. The Unix design philosophy (well described in Eric Raymond's book, The Art of Unix Programming) is brilliant and close to timeless, but the system itself is aging, as it is built around past assumptions and conventions. The trend has been towards object-oriented languages and complex user-space frameworks, as the Unix API and C library itself become less and less sufficient for modern applications. The Unix environment needs to evolve. ZZ is born out of passion for the Unix environment, and meant to increase the efficiency, simplicity and modularity of Unix.

Anticipated questions

What is the risk for a memory leak, using shared memory?
The same as for heap memory. The segments used by ZZ are automatically destroyed at the last detachment, and thus will not persist after execution, no matter how execution ends.
What is the risk for someone manipulating shared memory?
The segments used by ZZ can only be attached by the same user who created them. Segment IDs are normally not revealed to the user, though (at least under Linux) they can be seen in /proc/sysvipc/shm.
Why not build this into the Linux kernel instead?
Sure, why not? It might be even more efficient. But it would not be portable. Anyone wanting to use a ZZ application would have to patch their kernel.