Chapter 9 Message Passing Copyright © 2008. Operating Systems, by Dhananjay Dhamdhere Copyright © 20089.2Operating Systems, by Dhananjay Dhamdhere2 Introduction.

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

Processes Management.
IPC (Interprocess Communication)
Remote Procedure Call (RPC)
©2009 Operačné systémy Procesy. 3.2 ©2009 Operačné systémy Process in Memory.
Abhinav Kamra Computer Science, Columbia University 4.1 Operating System Concepts Silberschatz, Galvin and Gagne  2002 Chapter 4: Processes Process Concept.
 Introduction Originally developed by Open Software Foundation (OSF), which is now called The Open Group ( Provides a set of tools and.
Lecture 3 Page 1 CS 239, Spring 2001 Interprocess Communications in Distributed Operating Systems CS 239 Distributed Operating Systems April 9, 2001.
Chapter 3: Processes.
CS490T Advanced Tablet Platform Applications Network Programming Evolution.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Learning Objectives Understanding the difference between processes and threads. Understanding process migration and load distribution. Understanding Process.
3.5 Interprocess Communication
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Chapter 2: Application layer  2.1 Web and HTTP  2.2 FTP 2-1 Lecture 5 Application Layer.
Chapter 3: Processes. Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication in Client-Server.
02/02/2004CSCI 315 Operating Systems Design1 Interprocesses Communication Notice: The slides for this lecture have been largely based on those accompanying.
Asynchronous Message Passing EE 524/CS 561 Wanliang Ma 03/08/2000.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Operations on Processes Cooperating.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Chapter 3: Processes Process Concept.
02/01/2010CSCI 315 Operating Systems Design1 Interprocess Communication Notice: The slides for this lecture have been largely based on those accompanying.
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
Chapter 4.1 Interprocess Communication And Coordination By Shruti Poundarik.
Chapter 30 Electronic Mail Representation & Transfer
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Interprocess Communication. Process Concepts Last class.
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
Electronic Mail (SMTP, POP, IMAP, MIME)
Process-to-Process Delivery:
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
1 Computer Communication & Networks Lecture 27 Application Layer: Electronic mail and FTP Waleed.
Inter-process Communication and Coordination Chaitanya Sambhara CSC 8320 Advanced Operating Systems.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
Inter-Process Communication Mechanisms CSE331 Operating Systems Design.
1 Chapter 2. Communication. STEM-PNU 2 Layered Protocol TCP/IP : de facto standard Our Major Concern Not always 7-layered Protocol But some other protocols.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
Internet Protocol B Bhupendra Ratha, Lecturer School of Library and Information Science Devi Ahilya University, Indore
The Socket Interface Chapter 21. Application Program Interface (API) Interface used between application programs and TCP/IP protocols Interface used between.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
3.1 Silberschatz, Galvin and Gagne ©2009Operating System Concepts with Java – 8 th Edition Chapter 3: Processes.
1 11/1/2015 Chapter 4: Processes l Process Concept l Process Scheduling l Operations on Processes l Cooperating Processes l Interprocess Communication.
Processes. Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
CE Operating Systems Lecture 13 Linux/Unix interprocess communication.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-4 Process Communication Department of Computer Science and Software.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 3 Operating Systems.
Chapter 3: Process-Concept. Process Concept Process Scheduling Operations on Processes Cooperating Processes Interprocess Communication Communication.
Distributed systems (NET 422) Prepared by Dr. Naglaa Fathi Soliman Princess Nora Bint Abdulrahman University College of computer.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Linux Operations and Administration Chapter Twelve Configuring a Mail Server.
InterProcess Communication. Interprocess Communication Processes within a system may be independent or cooperating Cooperating process can affect or be.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Ch 2. Application Layer Myungchul Kim
1 Network Communications A Brief Introduction. 2 Network Communications.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Chapter 3: Process Concept
Processes Overview: Process Concept Process Scheduling
Subject Name: OPERATING SYSTEMS Subject Code: 10EC65
Chapter 4: Processes Process Concept Process Scheduling
Inter Process Communication (IPC)
Process-to-Process Delivery:
Hwajung Lee ITEC452 Distributed Computing Lecture 2 Interprocess Communication (IPC): An Overview.
Process-to-Process Delivery: UDP, TCP
Exceptions and networking
Presentation transcript:

Chapter 9 Message Passing Copyright © 2008

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere2 Introduction Overview of Message Passing Implementing Message Passing Mailboxes Higher-Level Protocols Using Message Passing Case Studies in Message Passing

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere3 Overview of Message Passing Message passing is one way in which processes interact with one another Processes may exist in the same computer or in different computers connected to a network Uses of message passing: –Client-server paradigm –Backbone of higher-level communication protocols –Parallel and distributed programs

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere4 Overview of Message Passing (continued) Two important issues in message passing are: –Naming of processes Names may be explicitly indicated or deduced by the kernel in some manner –Delivery of messages Whether sender should be blocked until delivery What the order is in which messages are delivered to a destination process How exceptional conditions are handled

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere5 Direct and Indirect Naming In direct naming, sender and receiver processes mention each other’s name –In symmetric naming, both sender and receiver processes specify each other’s name –In asymmetric naming, receiver does not name process from which it wishes to receive a message; kernel gives it a message sent to it by some process In indirect naming, processes do not mention each other’s name in send and receive statements

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere6 Blocking and Nonblocking Sends A blocking send blocks sender process until message is delivered to destination process –Synchronous message passing –Simplifies design of concurrent processes A nonblocking send call permits sender to continue its operation after send call –Asynchronous message passing –Enhances concurrency between sender and receiver In both cases, receive is typically blocking Kernel performs message buffering pending delivery

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere7 Exceptional Conditions in Message Passing To facilitate handling exceptional conditions, send and receive take two additional parameters: –Flags indicate how exceptions should be handled –status_area is for storing code concerning outcome Some exceptional conditions: 1.Destination process mentioned in send doesn’t exist 2.Source process does not exist (symmetric naming) 3.send cannot be processed (out of buffer memory) 4.No message exists for process when it makes receive 5.A set of processes become deadlocked when one is blocked on a receive

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere8 Implementing Message Passing

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere9 Delivery of Interprocess Messages Remember that: –An event control block (ECB) has three fields: Description of the anticipated event Id of the process that awaits the event An ECB pointer for forming ECB lists

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere10

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere11 Mailboxes Mailbox: repository for interprocess messages –Has a unique name –Owner is typically the process that created it Indirect naming –Only owner process can receive messages –Any process that knows name of a mailbox can send messages to it Kernel may provide fixed set of mailbox names, or it may permit user processes to assign the names –Varying levels of confidentiality

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere12 Mailboxes (continued)

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere13 Mailboxes (continued) Kernel may require a process to explicitly “connect” to a mailbox before starting to use it, and to “disconnect” when it finishes using it –May permit owner to destroy it, transfer ownership, etc. Use of a mailbox has following advantages: –Anonymity of receiver –Classification of messages Through use of separate mailboxes for different classes

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere14 Example: Use of Mailboxes An airline reservation system: –A set of booking processes –Server wishes to process cancellations before bookings and queries after both of them

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere15 Higher-Level Protocols Using Message Passing Several protocols use message passing paradigm to provide diverse services: –Simple mail transfer protocol (SMTP) delivers electronic mail –Remote procedure call (RPC) is a programming language facility for distributed computing Invokes a part of a program that is located on a different computer –Parallel virtual machine (PVM) and message passing interface (MPI) are message passing standards for parallel programming

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere16 The Simple Mail Transfer Protocol (SMTP) SMTP is used to deliver electronic mail to one or more users reliably and efficiently –Uses asymmetric naming –Can deliver mail across a number of interprocess communication environments (IPCEs ) –It is an applications layer protocol: uses TCP / IP SMTP consists of several simple commands: –MAIL, RCPT, DATA Typically used with a protocol that provides a mailbox –Internet Message Access Protocol (IMAP) –Post Office Protocol (POP)

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere17 Remote Procedure Calls Remote procedure call (RPC): used to invoke a part of a program located in a different computer –Semantics resemble those of a procedure call call ( ); – is a list of parameters Stubs perform marshaling of parameters and convert them to/from machine independent representations –SunRPC and OSF/DCE standards, Java RMI

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere18 Message Passing Standards for Parallel Programming Parallel program: set of tasks that can be performed in parallel –Executed on a heterogeneous set of computers or on a massively parallel processor (MPP) Parallel virtual machine (PVM) and message passing interface (MPI) are standards used in coding message passing libraries; provide: –Point-to-point communication between processes –Barrier synchronization between processes –Global operations for scattering (gathering) disjoint portions of data in a message to (from) different processes

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere19 Case Studies in Message Passing Message Passing in Unix Message Passing in Windows

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere20 Message Passing in Unix Three interprocess communication facilities: –Pipe: Data transfer facility Unnamed pipes can be used only by processes that belong to the same process tree –Message queue: analogous to a mailbox Used by processes within “Unix system domain” Access permissions indicate which processes can send or receive messages –Socket: one end of a communication path Can be used for setting up communication paths between processes within the Unix system domain and within certain Internet domains

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere21 Message Passing in Unix (continued) One common feature: processes can communicate without knowing each other’s identities

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere22 Message Passing in Unix: Pipes FIFO mechanism for data transfer between processes called reader and writer processes Usually implemented in file system –But, data put into a pipe can be read only once Removed from pipe when it is read by a process Two kinds of pipes: named and unnamed –Created through the system call pipe –A named pipe has an entry in a directory Like a file, but size is limited and kernel treats it as a queue

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere23 Message Passing in Unix: Message Queues Analogous to a mailbox Created and owned by one process –Creator specifies access permissions for send/receive Size specified at the time of its creation

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere24 Message Passing in Unix: Sockets A socket is one end of a communication path –Can be used for interprocess communication within the Unix system domain and in the Internet domain Server can set up communication paths with many clients simultaneously –Typically, after connect call, server forks a new process to handle the new connection Leaves original socket created by server process free to accept more connections Indirect naming: address (domain) used instead of process ids

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere25 Message Passing in Windows Named pipes: reliable bidirectional byte/message mode communication between server and clients –Implemented through the file system interface –Synchronous and asynchronous message passing Local Procedure Call (LPC) facility performs message passing between processes in same host –Choice of three methods of message passing Windows socket (Winsock) –Integrated with Windows message passing RPC: Synchronous and asynchronous

Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere26 Summary Message passing paradigm realizes exchange of information among processes without using shared memory Useful in: microkernel-based OSs, client–server computing, higher-level communication protocols, and parallel or distributed programs Sender/receiver naming: symmetric, asymmetric, indirect (mailbox) Message passing is employed in higher-level protocols such as SMTP, RPC, PVM, and MPI