Please enable JavaScript.
Coggle requires JavaScript to display documents.
Chapter 12
Semaphores, Shared Memory and Message Queues
Beginning Linux…
Chapter 12
Semaphores, Shared Memory and Message Queues
Beginning Linux Programming, Fourth Edition
A semaphore is a special variable on which only two operations are allowed; these operations are officially termed wait and signal.
-
-
-
-
-
Shared memory is a special range of addresses that is created by IPC for one process and appears in the address space of that process. Other processes can then “attach” the same shared memory segment into their own address space. All processes can access the memory locations just as if the memory had been allocated by malloc. If one process writes to the shared memory, the changes immediately become visible to any other process that has access to the same shared memory.
-
-
-
-
They are like named pipes, but without the complexity associated with opening and closing the pipe.
Message queues provide a reasonably
easy and efficient way of passing
data between two unrelated processes.
They have the advantage over named pipes that
the message queue exists independently
of both the sending and receiving
processes, which removes some of the
difficulties that occur in synchronizing
the opening and closing of named pipes.
-
-
-
-
-