SlideShare a Scribd company logo
1 of 28
Message
Passing
Operating
Systems
–
BSSE
2
nd
year
4
th
semester
Topics:
Synchronization
Addressing
Message Format
Queueing Discipline
Mutual Exclusion
B19103008
Amaim Shaikh
______________
Message Format
And Queueing
Discipline
B19103019
Hareem Saad
______________
Synchronization
B19103047
Neha Haroon
______________
Addressing
B19103065
Syeda Sughra
Raza
______________
Mutual
Exclusion
1.
Message
Passing
Message passing is a technique
for invoking behavior (i.e.,
running a program) on a
computer.
4
Message passing is the sharing of data by sending and receiving messages
between the processes.
Message passing satisfies the requirements of interaction between processes
i.e., synchronization and communication. Moreover, mutual exclusion can
only be carried out if processes are synchronized.
Physical implementation
● Single processor system
● Multiprocessor system
● Distributed system
The two
operations of
message passing
5
It's the method used by a process to send a
message to another process
The syntax is
Send (destination, message)
It's the method used by a process to receive a
message by another process
The syntax is
Receive (source, message)
Send Receive
2.
Synchronization
Process Synchronization is a way
to coordinate processes that use
shared data.
What Happens to a
process after it issues
a send primitive?
7
If the process resumes its work after sending a
message i.e. does not wait till the destination
process has received the message
If the process does not resumes its work after
sending a message i.e. it waits till the
destination process has received the message
Non-blocking Send Blocking send
What Happens to a
process after it issues
a receive primitive?
8
If the process performs its work even if no
message has been received i.e. it does not wait
till the it has received the message to start work
if a valid message exists it issues it otherwise it
issues a null message
If the process cannot perform its work until
after the message is received i.e. it waits till it
has received the message to start working
Non-blocking receive Blocking receive
In any system three
combinations of the above
primitives may occur
9
Blocking send,
blocking receive
Both the sender and receiver
are blocked until the message
has been delivered
It is sometimes referred to as a
rendezvous
Allows tight synchronization
sender continues on, while the
receiver is blocked until the
requested message arrives
It allows a process to send one
or more messages to a variety
of destinations as quickly as
possible
A process that must receive a
message before it can do useful
work needs to be blocked until
such a message arrives
Non-blocking send,
non-blocking receive
Neither party is required to
wait
Non-blocking send,
blocking receive
EXAMPLE
A process requests printing, it send the a message to
issue the request in the form of a message and then
carry on
DANGER
Due to the absence of blocking an error could lead to a
situation in which a process repeatedly generates
messages. Which would consume system resources,
including processor time and buffer space.
SOLUTION
The non-blocking send places the burden on the
programmer to determine that a message has been
received: Processes must employ reply messages to
acknowledge receipt of a message.
Non-blocking
send
02
03
01
EXAMPLE
A process requests printing, it send the a message to issue the request in the form of a
message and then carry on
DANGER
If a message is lost, which can happen in a distributed system, or if a process fails before
it sends an anticipated message, a receiving process could be blocked indefinitely.
SOLUTION
We can use a non-blocking receive to avoid the problem, but in that approach if the
message has been sent after the receiving process has been executed the message will be
lost forever.
Other possible approaches are to allow a process to test whether a message is waiting
before issuing a receive and allow a process to specify more than one source in a receive
primitive. The latter approach is useful if a process is waiting for messages from more
than one source and can proceed if any of these messages arrive.
Blocking Receive
02
03
01
3.
Addressing
Way of specifying :
In send primitive: who is to receive the message
In receiver primitive: who is source for message
TYPES :
1. Direct Addressing
2. Indirect Addressing
?
?
?
?
Direct
Addressing
13
Includes a specific identifier of
destination process
Send (destination, message)
Includes a source process (receiver must
know ahead of time which process to
expect as a source)
IMPLICIT ADDRESSING:
receive (source, message)
IN SEND IN RECEIVE
Possess a value returned when
receive operation performed.
Impossible
way
14
Messages are sent through a queue
that temporarily holds messages.
Merit:
● Greater flexibility
Indirect
Addressing
P P
sender receiver
sends to picks up
15
ONE-TO ONE
● Private communication
● Insulating from other
processes
MANY-TO-ONE
● Client-server interactions
● Mailbox is also called port
ONE-TO-MANY
● broadcasting MANY-TO-MANY
● N servers providing services
to M clients
Relationship
types
Process-Mailbox
Association
16
• Ports are statically associated with a process
• Ports are created and permanently assigned
to processes
e.g., ONE-TO-ONE relationship
• When many senders are associated
dynamically.
• connect and disconnect primitives used
here.
STATIC DYNAMIC
Process Ownership
of Mailbox
17
• Mailbox is created and owned by receiving
process
• When process (receiver) destroyed, port also
destroyed
• OS creates mailboxes.
• ownership is of creating processes.
• These mailboxes terminate with process.
• OS may terminate them explicitly
PORT OTHERS
4.
Message Format
There are two approaches of message
format
1. Fixed-length message
2. Variable-length message
Short length messages are preferred in some
operating system.
It is used to minimize processing and storage
overhead.
If large amount of data is required to be passed in
fixed-length messages, the data is placed in a file
and the messages references that file.
Fixed-length
message
02
03
01
Variable-length
message
20
Messages that do not have fixed length. The
length depends on how large the message is.
It consists of a header and a body.
Header contains the information about the
message ie type, id and etc.
There can be additional information such as
pointer, sequence number, priority field.
Body contains the message that is to be passed.
5.
Queuing Discipline
The order through which messages
are received by the receiver.
Queue is a repository of messages, and these messages are managed in First-in
First-out manner (FIFO). Messages are stored in queues and the messages that
are sent first are received first.
Alternative is to permit receiver to choose which message to receive next after
inspecting the message queue.
Another alternative is to receive messages according to their priority. Some
messages like error message are urgent and should to be received first, for this
reason messages are assigned priorities using a priority band. Ordinary
messages have a priority of zero. High-priority messages are high priority by
nature of their message type or designation by sender.
Alternative Approaches
02
03
01
23
6.
Mutual
Exclusion
Mutual exclusion is a property of process
synchronization which states that “no two
processes can exist in the critical section
at any given point of time”
24
● Only one process at a time is allowed in
the critical section for a resource.
● no deadlock or no starvation.
● A process that halts in its Non-critical
section must do so without interfering
with the processes.
● A process must not be delayed access
to a critical section when there is no
other process using it.
● A process remains inside its critical
section for a finite time only.
Requirements
For Mutual
Exclusion
> Critical Section is the part of a
program which tries to access shared
resources
Assume the use of the blocking receive primitive
and the nonblocking send primitive
A set of concurrent processes share a mailbox, box,
which can be used by all processes to send and
receive
The mailbox is initialized to contain a single
message with null content
Way to
enforce
Mutual
exclusion
02
03
01
A process wishing to enter its critical section first
attempts to receive a message
If the mailbox is empty, then the process is
blocked.
Once a process has acquired the message, it
performs its critical section and then places the
message back into the mailbox
Way to
enforce
Mutual
exclusion
05
06
04
27
This solution assumes that if more than one
process performs the receive operation
concurrently, then:
• If there is a message, it is delivered to only
one process and the others are blocked, or
• If the message queue is empty, all processes
are blocked; when a message is available, only
one blocked process is activated and given the
message.
These assumptions are true of virtually all
message-passing facilities.
University
of
Karachi
|
Dept
of
Computer
Science
Thanks!
Does anyone have any questions?

More Related Content

What's hot

File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing modelsishmecse13
 
Distributed Objects and Remote Invocation
Distributed Objects and Remote InvocationDistributed Objects and Remote Invocation
Distributed Objects and Remote InvocationMedicaps University
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corbaMayuresh Wadekar
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software conceptsPrajakta Rane
 
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionDistributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionSHIKHA GAUTAM
 
4.file service architecture
4.file service architecture4.file service architecture
4.file service architectureAbDul ThaYyal
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmpinki soni
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented CommunicationDilum Bandara
 
Structure of shared memory space
Structure of shared memory spaceStructure of shared memory space
Structure of shared memory spaceCoder Tech
 
Chapter 4 a interprocess communication
Chapter 4 a interprocess communicationChapter 4 a interprocess communication
Chapter 4 a interprocess communicationAbDul ThaYyal
 
Data-Intensive Technologies for Cloud Computing
Data-Intensive Technologies for CloudComputingData-Intensive Technologies for CloudComputing
Data-Intensive Technologies for Cloud Computinghuda2018
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating SystemsDr Sandeep Kumar Poonia
 

What's hot (20)

Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 
File models and file accessing models
File models and file accessing modelsFile models and file accessing models
File models and file accessing models
 
Distributed Objects and Remote Invocation
Distributed Objects and Remote InvocationDistributed Objects and Remote Invocation
Distributed Objects and Remote Invocation
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
 
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionDistributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock Detection
 
4.file service architecture
4.file service architecture4.file service architecture
4.file service architecture
 
Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
 
Distributed Systems Naming
Distributed Systems NamingDistributed Systems Naming
Distributed Systems Naming
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
 
Application Layer
Application LayerApplication Layer
Application Layer
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
 
Structure of shared memory space
Structure of shared memory spaceStructure of shared memory space
Structure of shared memory space
 
Chapter 4 a interprocess communication
Chapter 4 a interprocess communicationChapter 4 a interprocess communication
Chapter 4 a interprocess communication
 
Data-Intensive Technologies for Cloud Computing
Data-Intensive Technologies for CloudComputingData-Intensive Technologies for CloudComputing
Data-Intensive Technologies for Cloud Computing
 
System calls
System callsSystem calls
System calls
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
 

Similar to Message Passing Systems

1 messagepassing-121015032028-phpapp01
1 messagepassing-121015032028-phpapp011 messagepassing-121015032028-phpapp01
1 messagepassing-121015032028-phpapp01Zaigham Abbas
 
Apache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache CamelApache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache CamelOmi Om
 
Chapter 3b- Process Communication (1) (1)(1) (1).pptx
Chapter 3b- Process Communication (1) (1)(1) (1).pptxChapter 3b- Process Communication (1) (1)(1) (1).pptx
Chapter 3b- Process Communication (1) (1)(1) (1).pptxayeshabaig2004
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...Sehrish Asif
 
5_Interprocess Communication.pptx
5_Interprocess Communication.pptx5_Interprocess Communication.pptx
5_Interprocess Communication.pptxssuser2adefd1
 
Process Management.ppt
Process Management.pptProcess Management.ppt
Process Management.pptJeelBhanderi4
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systemsguest61205606
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systemsguest61205606
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systemsguest0f5a7d
 
Inter-Process communication in Operating System.ppt
Inter-Process communication in Operating System.pptInter-Process communication in Operating System.ppt
Inter-Process communication in Operating System.pptNitihyaAshwinC
 
Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...
Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...
Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...Dhivyaa C.R
 
Message passing Programing and MPI.
Message passing Programing and MPI.Message passing Programing and MPI.
Message passing Programing and MPI.Munawar Hussain
 
Inter Process Communication-R.D.Sivakumar
Inter Process Communication-R.D.SivakumarInter Process Communication-R.D.Sivakumar
Inter Process Communication-R.D.SivakumarSivakumar R D .
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process CommunicationAdeel Rasheed
 
Enterprise messaging with jms
Enterprise messaging with jmsEnterprise messaging with jms
Enterprise messaging with jmsSridhar Reddy
 
Ch4 OS
Ch4 OSCh4 OS
Ch4 OSC.U
 

Similar to Message Passing Systems (20)

Dos unit 2
Dos unit 2Dos unit 2
Dos unit 2
 
1 messagepassing-121015032028-phpapp01
1 messagepassing-121015032028-phpapp011 messagepassing-121015032028-phpapp01
1 messagepassing-121015032028-phpapp01
 
Apache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache CamelApache ActiveMQ and Apache Camel
Apache ActiveMQ and Apache Camel
 
Chapter 3b- Process Communication (1) (1)(1) (1).pptx
Chapter 3b- Process Communication (1) (1)(1) (1).pptxChapter 3b- Process Communication (1) (1)(1) (1).pptx
Chapter 3b- Process Communication (1) (1)(1) (1).pptx
 
Scopes in mule
Scopes in muleScopes in mule
Scopes in mule
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
 
5_Interprocess Communication.pptx
5_Interprocess Communication.pptx5_Interprocess Communication.pptx
5_Interprocess Communication.pptx
 
Process Management.ppt
Process Management.pptProcess Management.ppt
Process Management.ppt
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
MPI.pptx
MPI.pptxMPI.pptx
MPI.pptx
 
Inter-Process communication in Operating System.ppt
Inter-Process communication in Operating System.pptInter-Process communication in Operating System.ppt
Inter-Process communication in Operating System.ppt
 
Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...
Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...
Inter process communication by Dr.C.R.Dhivyaa, Assistant Professor,Kongu Engi...
 
Message passing Programing and MPI.
Message passing Programing and MPI.Message passing Programing and MPI.
Message passing Programing and MPI.
 
Inter Process Communication-R.D.Sivakumar
Inter Process Communication-R.D.SivakumarInter Process Communication-R.D.Sivakumar
Inter Process Communication-R.D.Sivakumar
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Enterprise messaging with jms
Enterprise messaging with jmsEnterprise messaging with jms
Enterprise messaging with jms
 
Ch4 OS
Ch4 OSCh4 OS
Ch4 OS
 
OS_Ch4
OS_Ch4OS_Ch4
OS_Ch4
 

Recently uploaded

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 

Recently uploaded (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 

Message Passing Systems

  • 2. Topics: Synchronization Addressing Message Format Queueing Discipline Mutual Exclusion B19103008 Amaim Shaikh ______________ Message Format And Queueing Discipline B19103019 Hareem Saad ______________ Synchronization B19103047 Neha Haroon ______________ Addressing B19103065 Syeda Sughra Raza ______________ Mutual Exclusion
  • 3. 1. Message Passing Message passing is a technique for invoking behavior (i.e., running a program) on a computer.
  • 4. 4 Message passing is the sharing of data by sending and receiving messages between the processes. Message passing satisfies the requirements of interaction between processes i.e., synchronization and communication. Moreover, mutual exclusion can only be carried out if processes are synchronized. Physical implementation ● Single processor system ● Multiprocessor system ● Distributed system
  • 5. The two operations of message passing 5 It's the method used by a process to send a message to another process The syntax is Send (destination, message) It's the method used by a process to receive a message by another process The syntax is Receive (source, message) Send Receive
  • 6. 2. Synchronization Process Synchronization is a way to coordinate processes that use shared data.
  • 7. What Happens to a process after it issues a send primitive? 7 If the process resumes its work after sending a message i.e. does not wait till the destination process has received the message If the process does not resumes its work after sending a message i.e. it waits till the destination process has received the message Non-blocking Send Blocking send
  • 8. What Happens to a process after it issues a receive primitive? 8 If the process performs its work even if no message has been received i.e. it does not wait till the it has received the message to start work if a valid message exists it issues it otherwise it issues a null message If the process cannot perform its work until after the message is received i.e. it waits till it has received the message to start working Non-blocking receive Blocking receive
  • 9. In any system three combinations of the above primitives may occur 9 Blocking send, blocking receive Both the sender and receiver are blocked until the message has been delivered It is sometimes referred to as a rendezvous Allows tight synchronization sender continues on, while the receiver is blocked until the requested message arrives It allows a process to send one or more messages to a variety of destinations as quickly as possible A process that must receive a message before it can do useful work needs to be blocked until such a message arrives Non-blocking send, non-blocking receive Neither party is required to wait Non-blocking send, blocking receive
  • 10. EXAMPLE A process requests printing, it send the a message to issue the request in the form of a message and then carry on DANGER Due to the absence of blocking an error could lead to a situation in which a process repeatedly generates messages. Which would consume system resources, including processor time and buffer space. SOLUTION The non-blocking send places the burden on the programmer to determine that a message has been received: Processes must employ reply messages to acknowledge receipt of a message. Non-blocking send 02 03 01
  • 11. EXAMPLE A process requests printing, it send the a message to issue the request in the form of a message and then carry on DANGER If a message is lost, which can happen in a distributed system, or if a process fails before it sends an anticipated message, a receiving process could be blocked indefinitely. SOLUTION We can use a non-blocking receive to avoid the problem, but in that approach if the message has been sent after the receiving process has been executed the message will be lost forever. Other possible approaches are to allow a process to test whether a message is waiting before issuing a receive and allow a process to specify more than one source in a receive primitive. The latter approach is useful if a process is waiting for messages from more than one source and can proceed if any of these messages arrive. Blocking Receive 02 03 01
  • 12. 3. Addressing Way of specifying : In send primitive: who is to receive the message In receiver primitive: who is source for message TYPES : 1. Direct Addressing 2. Indirect Addressing ? ? ? ?
  • 13. Direct Addressing 13 Includes a specific identifier of destination process Send (destination, message) Includes a source process (receiver must know ahead of time which process to expect as a source) IMPLICIT ADDRESSING: receive (source, message) IN SEND IN RECEIVE Possess a value returned when receive operation performed. Impossible way
  • 14. 14 Messages are sent through a queue that temporarily holds messages. Merit: ● Greater flexibility Indirect Addressing P P sender receiver sends to picks up
  • 15. 15 ONE-TO ONE ● Private communication ● Insulating from other processes MANY-TO-ONE ● Client-server interactions ● Mailbox is also called port ONE-TO-MANY ● broadcasting MANY-TO-MANY ● N servers providing services to M clients Relationship types
  • 16. Process-Mailbox Association 16 • Ports are statically associated with a process • Ports are created and permanently assigned to processes e.g., ONE-TO-ONE relationship • When many senders are associated dynamically. • connect and disconnect primitives used here. STATIC DYNAMIC
  • 17. Process Ownership of Mailbox 17 • Mailbox is created and owned by receiving process • When process (receiver) destroyed, port also destroyed • OS creates mailboxes. • ownership is of creating processes. • These mailboxes terminate with process. • OS may terminate them explicitly PORT OTHERS
  • 18. 4. Message Format There are two approaches of message format 1. Fixed-length message 2. Variable-length message
  • 19. Short length messages are preferred in some operating system. It is used to minimize processing and storage overhead. If large amount of data is required to be passed in fixed-length messages, the data is placed in a file and the messages references that file. Fixed-length message 02 03 01
  • 20. Variable-length message 20 Messages that do not have fixed length. The length depends on how large the message is. It consists of a header and a body. Header contains the information about the message ie type, id and etc. There can be additional information such as pointer, sequence number, priority field. Body contains the message that is to be passed.
  • 21. 5. Queuing Discipline The order through which messages are received by the receiver.
  • 22. Queue is a repository of messages, and these messages are managed in First-in First-out manner (FIFO). Messages are stored in queues and the messages that are sent first are received first. Alternative is to permit receiver to choose which message to receive next after inspecting the message queue. Another alternative is to receive messages according to their priority. Some messages like error message are urgent and should to be received first, for this reason messages are assigned priorities using a priority band. Ordinary messages have a priority of zero. High-priority messages are high priority by nature of their message type or designation by sender. Alternative Approaches 02 03 01
  • 23. 23 6. Mutual Exclusion Mutual exclusion is a property of process synchronization which states that “no two processes can exist in the critical section at any given point of time”
  • 24. 24 ● Only one process at a time is allowed in the critical section for a resource. ● no deadlock or no starvation. ● A process that halts in its Non-critical section must do so without interfering with the processes. ● A process must not be delayed access to a critical section when there is no other process using it. ● A process remains inside its critical section for a finite time only. Requirements For Mutual Exclusion > Critical Section is the part of a program which tries to access shared resources
  • 25. Assume the use of the blocking receive primitive and the nonblocking send primitive A set of concurrent processes share a mailbox, box, which can be used by all processes to send and receive The mailbox is initialized to contain a single message with null content Way to enforce Mutual exclusion 02 03 01
  • 26. A process wishing to enter its critical section first attempts to receive a message If the mailbox is empty, then the process is blocked. Once a process has acquired the message, it performs its critical section and then places the message back into the mailbox Way to enforce Mutual exclusion 05 06 04
  • 27. 27 This solution assumes that if more than one process performs the receive operation concurrently, then: • If there is a message, it is delivered to only one process and the others are blocked, or • If the message queue is empty, all processes are blocked; when a message is available, only one blocked process is activated and given the message. These assumptions are true of virtually all message-passing facilities.