Notes - MIECT
Sistemas De Operação
Notes - MIECT
Sistemas De Operação
  • Sistemas de Operação
  • Processes in Unix/Linux
    • Process
    • Multiprocessing vs. Multiprogramming
    • Processes in Unix
    • Execution of a C/C++ program
  • Introduction to operating systems
    • Global view
    • Evolution of computational systems
    • Key topics
  • Semaphores and Shared memory
    • Concepts
    • Semaphores
    • Shared memory
    • Unix IPC primitives
  • Threads, mutexes and condition variables in Unix/Linux
    • Threads
      • In linux
    • Monitors
    • Unix IPC primitives
  • Processes
    • Process
      • Diagrams
    • Process control table
    • Context switching
    • Threads
  • Processor Scheduling
    • Processor Scheduler
    • Short-term processor scheduler
    • Scheduling algorithms
    • Scheduling criteria
    • Priorities
    • Scheduling policies
      • In Linux
  • Interprocess communication
    • Concepts
    • Philosopher dinner
    • Access primitives
      • Software solutions
      • Hardware solutions
    • Semaphores
    • Monitors
    • Message-passing
    • Unix IPC primitives
  • Deadlock
    • Introduction
    • Philosopher dinner - Solution 1
      • Deadlock prevention
    • Philosopher dinner - Solution 2
      • Deadlock prevention
    • Philosopher dinner - Solution 3
      • Deadlock prevention
    • Philosopher dinner - Solution 4
    • Deadlock avoidance
    • Deadlock detection
  • Memory management
    • Introduction
    • Address space
    • Contiguous memory allocation
    • Memory partitioning
    • Virtual memory system
    • Paging
    • Segmentation
    • Combining segmentation and paging
    • Page replacement
      • Policies
    • Working set
    • Thrashing
    • Demand paging vs. preparing
Powered by GitBook
On this page
  • Introduction
  • Direct and indirect communication
  • Synchronization
  • Buffering
  • Bounded-buffer problem
  1. Interprocess communication

Message-passing

Introduction

Processes can communicate exchanging messages.

  • A general communication mechanism, not requiring explicit shared memory, that includes both communication and synchronization.

  • Valid for uniprocessor and multiprocessor systems.

Two operations are required:

  • send and receive.

A communication link is required.

  • That can be categorized in different ways:

    • Direct or indirect communication.

    • Synchronous or asynchronous communication.

    • Type of buffering.

Direct and indirect communication

Symmetric direct communication.

A process that wants to communicate must explicitly name the receiver or sender.

  • send(P, msg)– send message msg to process P

  • receive(P, msg) – receive message msg from process P

A communication link in this scheme has the following properties:

  • it is established automatically between a pair of communicating processes.

  • it is associated with exactly two processes.

  • between a pair of communicating processes there exist exactly one link.

Asymetric direct communication.

  • Only the sender must explicitly name the receiver.

    • send(P, msg)– send message msg to process P

    • receive(id, msg) – receive message msg from process P

Indirect communication

The messages are sent to and received from mailboxes, or ports.

  • send(M, msg)– send message msg to mailbox M

  • receive(M, msg) – receive message msg from mailbox M

A communication link in this scheme has the following properties:

  • it is only established if the pair of communicating processes has a shared mailbox.

  • it may be associated with more than two processes.

  • between a pair of processes there may exist more than one link (a mailbox per each).

The problem of two or more processes trying to receive a message from the same mailbox.

  • Is it allowed?

  • If allowed, which one will succeed?

Synchronization

From a synchronization point of view, there are different design options for implementing send and receive.

  • Blocking send – the sending process blocks until the message is received by the receiving process or by the mailbox.

  • Nonblocking send – the sending process sends the message and resumes operation.

  • Blocking receive – the receiver blocks until a message is available.

  • Nonblocking receive – the receiver retrieves either a valid message or the indication that no one exits.

Different combinations of send and receive are possible.

Buffering

There are different design options for implementing the link supporting the communication.

  • Zero capacity – there is no queue.

    • the sender must block until the recipient receives the message.

  • Bounded capacity – the queue has finite length.

    • if the queue is full, the sender must block until space is available.

  • Unbounded capacity – the queue has (potentially) infinite length.

Bounded-buffer problem

There is no need to deal with mutual exclusion and synchronization explicitly.

  • the send and receive primitives take care of it.

PreviousMonitorsNextUnix IPC primitives

Last updated 2 years ago