
Explore inter-process communication concepts and their Windows C++ implementations, including shared memory creation, pipes, and mail slots, for server-side applications.
Learn how shared memory enables inter-process communication by sharing data across processes via memory mapped files, allowing processes to reuse loaded data instead of reloading from the database.
Discover how shared memory enables cross-process data access through virtual memory, paging, and page faults, with the OS mapping pages between RAM and hard disk to share data.
Describe memory mapped files placing file content in virtual memory, enabling shared memory for processes to read and write the same data, not persisted after end.
Demonstrates inter-process communication with a memory mapped file in Windows C++, writing employee data to shared memory for a subsequent reader process.
Explain how pipes enable inter-process communication via shared memory, with a server writing and a client reading, and compare anonymous one-way pipes to named pipes with optional duplex.
Learn to create an anonymous Windows pipe with CreatePipe and perform write and read operations using h read and h write handles, synchronized by a manual reset event.
Discover how named pipes support one-way and duplex communication with individual buffers and handles, while servers create pipes and clients connect via CreateNamedPipe or CreateFile.
Learn to implement a multithreaded named pipe server in Windows C++, handling client connections with a per-client thread, using blocking mode, and exchanging messages.
Demonstrate a named pipe client in Windows C++, connecting to the server, sending a demo message, and receiving the server's reply while properly handling the read buffer.
Discover overlapped input/output in named pipes, enabling a server to handle multiple clients simultaneously across pipe instances with an overlapped structure and an event kernel object.
The lecture explains overlapped i/o pipe server implementation in Windows C++, showing a four-client multi-client setup with precreated pipe instances and event handles, and synchronized connect, read, and write operations.
Learn how named pipe transactions treat a task as an atomic unit, enabling all or nothing execution on duplex message type pipes using transact named pipe and call named pipe.
Demonstrate a working transacted named pipe in Windows C++, with a client and server exchanging messages in a single transaction using transact named pipe and create file APIs.
Explore mail slots as a one-way inter-process communication mechanism for offline messaging using datagrams. Learn about mail slot server and client roles, the 424-byte limit, and how handles govern access.
Explore mail slot naming conventions and operations in Windows C++, including name formats, domain-specific messaging, and how to open, read, write, and close mail slots.
Create a mail slot in a windows c++ console app using a make_slot function, set the slot name, and specify inheritable security attributes; build and run to verify creation.
Learn to implement inter process communication by writing content to a mail slot in Windows, opening the same slot for writing, and keeping it available during read/write operations.
Explore reading from a Windows mail slot by creating the slot, allowing another process to write to it, and reading and printing messages using overlapped asynchronous operations.
Interprocess communication (IPC) is a fundamental concept in programming, allowing separate processes to exchange data and signals efficiently and securely. In the context of C++, IPC mechanisms enable coordination and cooperation among running applications as they share resources and data on various operating systems. Understanding and utilizing IPC can greatly enhance the functionality and performance of applications.
### Understanding Processes and the Need for IPC
A process is an instance of a computer program that's being executed, which contains the program code and its current activity. In modern operating systems, each process operates in its own virtual address space and does not have permission to access the memory or resources of another process directly. This isolation ensures that processes do not interfere with each other, which enhances the stability and security of software applications. However, there are scenarios where processes need to share data or notify each other about events or changes, which is where IPC comes into play.
These concepts are used for most of the implementations in real life server side projects. In this course you will learn about Shared Memory, Pipes and MailSlots.
The downloadable resources are available to help you out to see the real code in action.