2. IPC
• Inter-process communication is the mechanism provided by the
operating system that allows processes to communicate with each
other.
• This communication could involve a process letting another process
know that some event has occurred or the transferring of data from
one process to another.
3. SYNCHRONIZATION
• Some of the methods to provide synchronization are as follows −
• Semaphore: A semaphore is a variable that controls the access to a
common resource by multiple processes.
• Mutual Exclusion: Mutual exclusion requires that only one process
thread can enter the critical section at a time.
• Barrier: A barrier does not allow individual processes to proceed until
all the processes reach it.
• Spinlock: This is a type of lock. The processes trying to acquire this
lock wait in a loop while checking if the lock is available or not.
5. • A pipe is a data channel that is unidirectional. Two pipes can be used
to create a two-way data channel between two processes.
• Message Passing:
• It is a mechanism for a process to communicate and synchronize.
• Using message passing, the process communicates with each other
without resorting to shared variables.
PIPES
6. MESSAGE QUEUES
• A message queue is a linked list of
messages stored within the kernel.
• It is identified by a message queue
identifier.
• This method offers communication
between single or multiple processes
with full-duplex capacity.
• Message queues are quite useful for
inter process communication and are
used by most operating systems.
7. SHARED MEMORY
• Shared memory is the memory that can be
simultaneously accessed by multiple processes.
This is done so that the processes can
communicate with each other.
• Shared memory is a memory shared between
two or more processes that are established
using shared memory between all the
processes.
• This type of memory requires to protected from
each other by synchronizing access across all
the processes.
8. DIRECT COMMUNICATION
• In the Direct Communication, each process that wants to communicate
must explicitly name the recipient or sender of the communication.
• In this, process that want to communicate must name the sender or
receiver.
1. A pair of communicating processes must have one link between them.
2. A link (generally bi-directional) establishes between every pair of
communicating processes.
9. INDIRECT COMMUNICATION
• Pairs of communicating processes have shared mailboxes.
• Link (uni-directional or bi-directional) is established between pairs of
processes.
• Sender process puts the message in the port or mailbox of a receiver
process and receiver process takes out (or deletes) the data from the
mailbox.
• A link can communicate with many processes. The link may be bi-
directional or unidirectional.
10. FIFO
• FIFOs (first-in, first-out) are a
variation on a pipe that creates a more
flexible communication structure.
• FIFOs work by attaching a filename
to the pipe. For this reason, FIFOs are
also called named pipes as opposed to
the anonymous pipes discussed
previously.
• FIFOs are created by one process that
calls mkfifo().