This document discusses various inter-process communication (IPC) mechanisms in Linux, including pipes, FIFOs, and message queues. Pipes allow one-way communication between related processes, while FIFOs (named pipes) allow communication between unrelated processes through named pipes that persist unlike anonymous pipes. Message queues provide more robust messaging between unrelated processes by allowing messages to be queued until received and optionally retrieved out-of-order or by message type. The document covers the key functions and system calls for creating and using each IPC mechanism in both shell and C programming.
Introduction to Inter Process Communication, its significance, and introductory copyright information.
Discusses what participants can expect from the workshop: understanding IPC mechanisms like Pipes, FIFOs, Message Queues, Shared Memory, and Semaphores.
Explains why separate IPC mechanisms are needed for non-sharing processes and introduces signals as a basic but insufficient communication method.
Defines IPC and its function as the exchange of data between processes, highlighting its directions: Uni-, Bi-, and Multi-directional.
Illustrates IPC with an example of printing filenames using 'ls' and 'lpr', showcasing solutions such as using files or pipes.
Describes various IPC mechanisms: Pipes, FIFOs, Message Queues, Shared Memory, and Mapped Memory, outlining their purposes and requirements.
Introduces the concept of Pipes as a one-way communication channel with information on usage, creation, and functionality within processes.
Discusses two-way pipes, their restrictions, and mentions special pipes for communication between unrelated processes.
Defines FIFOs as named pipes allowing independent processes to communicate, maintaining similar properties to standard pipes.
Demonstrates how to create and communicate through FIFOs using shell commands and programming methods in C.
Describes the Broken Pipe condition and the handling of SIGPIPE to prevent abnormal exit on failed pipe communication.
Discusses scenarios where FIFOs may not be sufficient for certain applications due to out-of-order processing needs.
Explains Message Queues as a means for IPC where messages are held until received, detailing usage benefits over FIFOs.
Shows how to create and manage message queues using shell commands and system calls in C.
Details operations for sending and receiving messages, including data formats and system calls for managing queues.
Stresses the importance of explicitly deleting message queues to avoid violating system limits.
Describes the data structures associated with message queues detailing permissions and last operation timestamps.
Provides an example of two programs interacting through message queues to demonstrate practical usage.
Evaluates the limitations of Message Queues regarding immediate data sharing and potential overheads.
Defines Shared Memory as a fast IPC mechanism for sharing data among processes with user-managed synchronization.
Explains the virtual memory model in Linux, highlighting how multiple processes can share actual physical memory.
Describes how to create, access, detach, and control shared memory segments using shell commands and C system calls.
Alerts on the necessity of explicit deallocation of shared memory to prevent system limit violations.
Details the structure used in shared memory management with attributes related to ownership and control.
Demonstrates usage of shared memory through example programs to illustrate interaction between processes.
Discusses the need for access coordination in shared memory and introduces semaphores for synchronization.
Defines process semaphores as synchronization tools for managing access to shared resources among processes.
Explains the typical usage of a semaphore in managing access to a shared resource with conditions and atomicity.
Describes specialized semaphores including binary semaphores and mutexes used for resource ownership management.
Details semaphore operations including allocation, control actions, and the key data structures involved.
Warnings regarding the explicit need to remove semaphores, similar to other IPC mechanisms.
Presents methods for initializing semaphores in an array and the required command structures used.
Details on how to perform operations on semaphores, including common atomic operations and flags.
Showcases examples demonstrating semaphores used in conjunction with shared memory.
Defines Mapped Memory as a variant of shared memory that uses a shared disk file instead of physical memory.
Explains how to map and manage files into memory using mmap() for efficient access and cleanup.
Highlights the synchronization needs when accessing mapped memory, suggesting semaphores for management.
Recap of major topics covered related to IPC mechanisms: Pipes, FIFOs, Message Queues, Shared Memories, and Semaphores.
Invites questions from participants, concluding the workshop presentation.