1. Trang chủ
  2. » Công Nghệ Thông Tin

Lecture Operating systems: A concept-based approach (2/e): Chapter 10 - Dhananjay M. Dhamdhere

16 36 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 16
Dung lượng 628,8 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Chapter 10 - Message passing. This chapter discusses the semantics of message passing, and OS responsibilities in buffering and delivery of interprocess messages. It also discusses how message passing is employed in higher-level protocols for providing electronic mail facility and in providing intertask communication in parallel or distributed programs.

Trang 1

Message Passing Dhamdhere: Operating Systems—A Concept­Based Approach, 2 ed Copyright © 2008Slide No: 1

  

PROPRIETARY MATERIAL. ©  2007 The McGraw­Hill Companies, Inc. All rights reserved. No part of this PowerPoint slide  may be displayed, reproduced or distributed 

in any form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw­Hill  for their individual course preparation. If you are a student using this PowerPoint slide, you are using it without permission. 

Trang 2

Message passing preliminaries

•  The sender process names the destination process and provides the message

•  The destination process specifies an area in which the message should be put

Trang 3

Message Passing Dhamdhere: Operating Systems—A Concept­Based Approach, 2 ed Copyright © 2008Slide No: 3

  

Issues in message passing

* Direct and indirect naming

 Direct: Process names are specified in send / receive commands

 Indirect: Process names are inferred by the kernel

* Symmetric and asymmetric naming

 Symmetric: Both sender and receiver processes specify each other’s names

 Asymmetric: Receiving process does not specify name of a sender process

Trang 4

Issues in message passing

* Process executing a receive command is blocked until a message is delivered

* The sender process may or may not be blocked until delivery

 Synchronous message passing: sender is blocked

» Simplifies message passing, saves memory

 Asynchronous message passing: sender is not blocked

* Order in which messages are delivered

* Handling of exceptions like non-existing processes, undeliverable messages

Trang 5

Message Passing Dhamdhere: Operating Systems—A Concept­Based Approach, 2 ed Copyright © 2008Slide No: 5

  

Issues in message passing

– Buffering of messages

* Kernel builds an interprocess message control block (IMCB)

* IMCB is stored in an appropriate data structure

 The message may be stored in IMCB or separately

– Blocking and unblocking of processes

* May be performed using event control blocks (ECBs)

Trang 6

Interprocess message control block (IMCB)

Trang 7

Message Passing Dhamdhere: Operating Systems—A Concept­Based Approach, 2 ed Copyright © 2008Slide No: 7

  

Lists of IMCBs pending delivery of messages

Trang 8

Symmetric naming and blocking sends

(a) A process executes send and destination process has not executed receive

Trang 9

Message Passing Dhamdhere: Operating Systems—A Concept­Based Approach, 2 ed Copyright © 2008Slide No: 9

  

Symmetric naming and blocking sends

Trang 10

Symmetric naming and blocking sends

Trang 11

Message Passing Dhamdhere: Operating Systems—A Concept­Based Approach, 2 ed Copyright © 2008Slide No: 11

  

Mailbox

•  A mailbox has a name and is a repository of messages

•  Processes connect to a mailbox and send / receive messages from it

Trang 12

– Anonimity of receiver

* A sender process need not know identity of receiver process

– Classification of messages

* A process can use numerous mailboxes, one for each kind of message

Trang 13

Message Passing Dhamdhere: Operating Systems—A Concept­Based Approach, 2 ed Copyright © 2008Slide No: 13

  

Use of mailboxes

•  An airline reservations process uses three mailboxes  ─ book, enquire, receive

•  This way it can process cancellations followed by bookings followed by queries

Trang 14

Message passing in Unix

    Pipe       Message queue       Socket

Trang 15

Message Passing Dhamdhere: Operating Systems—A Concept­Based Approach, 2 ed Copyright © 2008Slide No: 15

  

Reservations server in Unix 5.4

•  Cancellation, booking and enquiry messages are assigned types 1, 2 and 3 resp

•  The msgrcv call returns a cancellation message, if present

•  If no cancellation messages exist, it returns a bookings message, if present, or

   an enquiry message

Trang 16

Message passing in Windows

– Local procedure call (LPC) for message passing between

processes located in the same computer

* Provides three types of message passing

 Small and large messages are sent using ports, where a port is like a mailbox

» Small messages are stored in the port, large messages are stored in section objects

Quick LPC: A server creates a thread for each client This

thread and the client use event pair objects to synchronize

Ngày đăng: 30/01/2020, 01:05

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN