EmbeddedRelated.com
Books
Jacob Beningo
Live online course · Jacob Beningo
AI for Embedded Developers
$100 off for EmbeddedRelated readers until Dec 6 · 5 live sessions, Dec 7-11
Discount ends in
28days 02hrs 22min 15sec
Learn More →

Interprocess Communications in Linux: The Nooks and Crannies

Gray, John Shapley Gray ● 2003

Interprocess Communications in Linux explains exactly how to use Linux processes and interprocess communications to build robust, high-performance systems. Coverage includes: named/unnamed pipes, message queues, semaphores, shared memory, RPC and the rpcgen compiler, sockets-based communication, the /proc file system, LinuxThreads POSIX support, multithreading, and much more. Includes detailed exercises, plus dozens of downloadable program examples compiled with GNU C/C++ 2.96 & 3.2 and tested with Red Hat Linux 7.3 & 8.0.


Why Read This Book

You should read this book if you need a practical, Linux-centric deep dive into interprocess communication and concurrency: it shows the system calls, APIs, and real code examples that get IPC right in production. You will gain hands-on techniques for building robust, high-performance communication between processes and threads on Linux systems.

Who Will Benefit

Embedded Linux developers, firmware engineers, and systems programmers who build multi-process or multi-threaded applications and need to understand Linux IPC internals and practical APIs.

Level: Intermediate — Prerequisites: Working knowledge of C programming, basic Linux command line and development tools, and familiarity with processes/threads and basic OS concepts.

Get This Book

Key Takeaways

  • Implement and use unnamed and named pipes (FIFOs) correctly for process communication.
  • Use System V and POSIX message queues, semaphores, and shared memory for efficient IPC.
  • Build socket-based communication (UNIX domain and TCP/IP) and understand when to choose each.
  • Create and use RPC services with rpcgen and understand RPC trade-offs.
  • Write and debug multithreaded programs using LinuxThreads/pthreads and handle synchronization safely.
  • Inspect and leverage the /proc filesystem and standard tools to observe and debug IPC and process state.

Topics Covered

  1. Introduction to IPC and Linux process model
  2. Signals and basic process control
  3. Pipes and FIFOs (unnamed and named)
  4. System V IPC: message queues, semaphores, shared memory
  5. POSIX IPC: message queues, semaphores, shared memory
  6. Sockets: UNIX domain and TCP/IP basics
  7. Advanced socket programming and network considerations
  8. RPC and the rpcgen tool
  9. Threads, LinuxThreads and pthreads
  10. Synchronization primitives and concurrency patterns
  11. The /proc filesystem and process inspection
  12. Performance, debugging and common pitfalls
  13. Exercises, annotated examples and appendices (API references)

Languages, Platforms & Tools

CC++Linux (general; examples tested on Red Hat 7.x/8.x; applicable to embedded Linux/x86/ARM)gccmakerpcgengdbstrace

How It Compares

Overlaps with Stevens' Advanced Programming in the UNIX Environment but is more Linux-focused and example-driven; for a more modern system-level view see Robert Love's Linux System Programming which covers newer kernels and APIs.

Related Books

Bryant, Randal, O'Hallaron,...