0% 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.

Uploaded by

Atul Draws
Copyright
© © All Rights Reserved
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% 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.

Uploaded by

Atul Draws
Copyright
© © All Rights Reserved
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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy