There are two models of interprocess communication: message passing and shared memory. Message passing involves processes passing messages to a message queue managed by the kernel. Shared memory allows one process to share its memory space with another process without kernel involvement, though the kernel helps create the shared memory. The producer-consumer problem addresses how a producer process generates information for a consumer process to use, such as a compiler producing data for an assembler, utilizing a shared buffer and synchronization between the processes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
48 views2 pages
OS Mod 2 IPC
There are two models of interprocess communication: message passing and shared memory. Message passing involves processes passing messages to a message queue managed by the kernel. Shared memory allows one process to share its memory space with another process without kernel involvement, though the kernel helps create the shared memory. The producer-consumer problem addresses how a producer process generates information for a consumer process to use, such as a compiler producing data for an assembler, utilizing a shared buffer and synchronization between the processes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Mod 2 IPC
There are two fundamental models of interprocess communication:
message passing and shared memory
Message passing: process A and B pass message to message queue (present in
kernel). Kernel is always involved. Shared memory: One process shares its message to the shared memory. The other process receives the message from the shared memory. Kernel is not involved in the process but kernel helps in the creation of the shared memory.
Producer – consumer problem
Producer produces info and consumer consumes that info. Eg: compiler produces info and assembler consumes it. A buffer (a shared memory region) is present. The producer process gives the data to the buffer and the consumer process receives it from the buffer. The producer and consumer processes must be synchronized -- because consumer can only consume if producer has produced something. So the order of production and consumption matters. Two types of buffers are used bounded buffer (has fixed buffer size) and unbounded buffer (no limit for the buffer size). Two pointers are used in buffer: in and out. ‘In’ points to first free position ‘out’ points to first full position. If in and out point to same position, the buffer is empty. If ((in + 1) % BUFFER SIZE) == out, then buffer is full.