Task Communication
Task Communication
Introduction
• In multi tasking system, multiple tasks/processes executed
concurrently and they may or may not communication with
each other.
• Based on communication, the processes are classified as
1. Co – operating processes
2. Competing processes.
• Co – operating processes: in this one process requires the
inputs from other processes to complete its execution.
• Competing Processes: This processes do not share any
thing among them but share system resources.
Introduction Cont….
• Co – operating processes exchanges information and
communication through following methods.
– 1. Co – operation through sharing: exchange data
through shared resources.
– 2. Co – operation through communication: No data is
shared but communicate for synchronization.
• Inter process communication (IPC) is a mechanism
which allows processes to communicate each other
and synchronize their actions.
• IPC is essential for process coordination.
Inter Process Communication Mechanisms
• There are various IPC mechanisms used by process depends
on OS.
• The various mechanisms are:
1. Shared memory
– Pipes
– Memory mapped objects
2. Message passing
– Message Queue
– Mail Box
– Signaling
3. Remote procedure call (RPC) and sockets.
Shared Memory
• Shared memory is simplest way of inter process
communication.
• Shared memory IPCs refer to sharing a physical memory
location where multiple processes read and write to.
• It is same as the real world example where Notice Board
• The only exception is; only corporate have the right to modify
the information published on the Notice board and
employees are given ‘Read’ only access, meaning it is only a
one way channel
Shared Memory Cont….
Authentication mechanisms
like IDs, public key
cryptography (like DES,
3DES), etc. are used by the
client for authentication.
Sockets
• Sockets are one of the most widely used communication APIs.
• A socket is an object from which messages and are sent and
received.
• A socket is a network communication endpoint.
• Socket is a logical endpoint in a two-way communication link
between two applications running on a network .
• Sockets are of different types i e ., Internet sockets (INET),
UNIX sockets, etc.
• The INET socket works on internet communication protocol
TCP/IP, UDP, etc. are the communication protocols used by
INET sockets.
Sockets Cont…
• INET sockets are classified into:
• 1. Stream sockets
• 2. Datagram sockets
• Connection Oriented:
• TCP (Transmission Control Protocol) is a connection-based
protocol that provides a reliable flow of data between two computers.
Stream sockets are connection oriented
• Connectionless:
UDP (User Datagram Protocol) is a protocol that sends independent
packets of data, called datagram's, from one computer to another
with no guarantees about arrival. UDP is not connection-based like TCP.