Learn how to use message queues, semaphores, and shared memory to connect your applications
UNIX provides several methods for IPC. The SysV IPC methods are message queues, semaphores, and shared memory. Message queues allow one application to submit a message that other applications can pick up later, even after the sending application has finished. Semaphores ensure that multiple applications can lock resources and avoid race conditions. Shared memory allows multiple applications to share a common segment of memory, which provides a fast method of communicating and sharing large amounts of data. You can also use these methods together. For example, you can use a semaphore to control access to a shared memory segment.
IPC methods are helpful to application developers because they provide a standard way to communicate between applications and are portable across different UNIX flavors. The next time you find yourself needing to lock resources or share data between processes, try the SysV IPC mechanisms.
Read more at IBM developerworksShare this on: