Channels.

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Remote Procedure Call (RPC)
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
1 Chapter 8 Channels. 2 Concurrent Programming Constructs So far we have seen contructs based on shared memory concept (shared directly – buffer - or.
28.2 Functionality Application Software Provides Applications supply the high-level services that user access, and determine how users perceive the capabilities.
Introduction in algorithms and applications Introduction in algorithms and applications Parallel machines and architectures Parallel machines and architectures.
1 Semaphores Special variable called a semaphore is used for signaling If a process is waiting for a signal, it is suspended until that signal is sent.
Chapter 11: Distributed Processing Parallel programming Principles of parallel programming languages Concurrent execution –Programming constructs –Guarded.
Asynchronous Message Passing EE 524/CS 561 Wanliang Ma 03/08/2000.
1 Chapter 4 Threads Threads: Resource ownership and execution.
CS603 Communication Mechanisms 14 January Types of Communication Shared Memory Message Passing Stream-oriented Communications Remote Procedure Call.
On the Duality of Operating System Structures Hugh C. Lauer Xerox Corporation Roger M. Needham Cambridge University Presented By: Ashwini Kulkarni.
Chapter 26 Client Server Interaction Communication across a computer network requires a pair of application programs to cooperate. One application on one.
What is Concurrent Programming? Maram Bani Younes.
1 Chapter 9 Spaces with LINDA. 2 Linda Linda is an experimental programming concept unlike ADA or Occam which are fully developed production-quality languages.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 12 Communicating over.
Messaging is an important means of communication between two systems. There are 2 types of messaging. - Synchronous messaging. - Asynchronous messaging.
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
1 Concurrency Architecture Types Tasks Synchronization –Semaphores –Monitors –Message Passing Concurrency in Ada Java Threads.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
 Remote Procedure Call (RPC) is a high-level model for client-sever communication.  It provides the programmers with a familiar mechanism for building.
1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Distributed Computing A Programmer’s Perspective.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Synchronization Methods in Message Passing Model.
Distributed Programming Concepts and Notations. Inter-process Communication Synchronous Messages Asynchronous Messages Select statement Remote procedure.
1 Client-Server Interaction. 2 Functionality Transport layer and layers below –Basic communication –Reliability Application layer –Abstractions Files.
Remote Procedure Call Andy Wang Operating Systems COP 4610 / CGS 5765.
Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy. Presented by: Tim Fleck.
Mark Stanovich Operating Systems COP Primitives to Build Distributed Applications send and receive Used to synchronize cooperating processes running.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Chapter 7 - Interprocess Communication Patterns
Distributed objects and remote invocation Pages
Channels. Models for Communications Synchronous communications – E.g. Telephone call Asynchronous communications – E.g. .
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Remote Procedure Calls
Last Class: Introduction
Chapter 3: Process Concept
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
“Language Mechanism for Synchronization”
Chapter 3 Internet Applications and Network Programming
CS533 Concepts of Operating Systems
Processes Overview: Process Concept Process Scheduling
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Programming Models for Distributed Application
Concurrency: Mutual Exclusion and Synchronization
CSE 451: Operating Systems Winter 2006 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Hwajung Lee ITEC452 Distributed Computing Lecture 7 Interprocess Communication (IPC): An Overview.
Sarah Diesburg Operating Systems COP 4610
CSE 451: Operating Systems Autumn 2003 Lecture 16 RPC
Hwajung Lee ITEC452 Distributed Computing Lecture 2 Interprocess Communication (IPC): An Overview.
Slides for Chapter 6: Operating System support
CSE 451: Operating Systems Winter 2007 Module 20 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Remote Procedure Call (RPC) Neil Tang 11/26/2008
What is Concurrent Programming?
CSE 451: Operating Systems Winter 2004 Module 19 Remote Procedure Call (RPC) Ed Lazowska Allen Center
Channels.
Multithreaded Programming
What is Concurrent Programming?
Subject : T0152 – Programming Language Concept
Computer Science 312 Concurrent Programming I Processes and Messages 1.
Typically for using the shared memory the processes should:
Channels.
CSE 451: Operating Systems Winter 2003 Lecture 16 RPC
Synchronization and semaphores
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
Presentation transcript:

Channels

Models for Communications Synchronous communications E.g. Telephone call Asynchronous communications E.g. Email

Addressing Symmetric addressing Asymmetric addressing channels: rather than naming the processes, named channels are declared for use by a pair or a group of processes. Asymmetric addressing client–server systems, The client has to know the name of the service it requests, while the server can be programmed without knowledge of its future clients. If needed, the client identification must be passed dynamically as part of the message.

Data Flow One way Data Flow Two way Data Flow Which one is better?

Channels A channel connects a sending process with a receiving process. Channels are typed, meaning that you must declare the type of the messages that can be sent on the channel.

Producer–consumer (channels)   channel of integer ch Producer Consumer integer x loop forever p1: x ← produce p2: ch ⇐ x integer y q1: ch ⇒ y q2: consume(y)

Conway’s Problem The Input of this Algorithm is a sequence of characters sent by an environment process to an input channel. The output is the same sequence sent to an environment process after performing two transformations: Runs of 2<=n<=9 occurrences of the same character are replaced by the digit corresponding to n and the character. A newline character is appended following every Kth character of the transformed sequence.

Conway’s problem

Conway’s problem (a) runs of 2 ≤ n ≤ 9 occurrences of the same character are replaced by the digit corresponding to n and the character; (b) a newline character is appended following every K th character of the transformed sequence. The algorithm is quite easy to follow because the two transformations are implemented in separate processes: the compress process replaces runs as required and sends the characters one by one on the pipe channel, while the output process takes care of inserting the newline characters

Matrix Multiplication One-way channels are extremely efficient, and can be implemented in hardware. Transputer: CPU, memory and four pairs of one-way channel on a single chip.

Matrix Multiplication

Process Array for Matrix Multiplication

Exercise 7 9 1 1 0 8 10 X 1 0 1 9 11 0 0 2

Exercise

Multiplier Process With Channels

Dining Philosophers With Channels

Rendezvous The name rendezvous invokes the image of two people who choose a place to meet; the first one to arrive must wait for the arrival of the second. In the synchronization construct, the location of the rendezvous belongs to one of the processes, called the accepting process. The other process, the calling process.

Rendezvous Processes (Accepting, Calling) The calling process , must know the identity of the accepting process and the identity of the rendezvous which is called an entry.  The accepting process does not know and does not need to know the identity of the calling process. Then, the rendezvous is appropriate for implementing servers that export their services to all potential clients.

Rendezvous (Client Server)

Semantics Diagram The semantics of a rendezvous are illustrated in the following diagram:

Remote Procedure Calls Remote procedure call (RPC) is a construct that enables a client to request a service from a server that may be located on a different processor. The client calls a server in a manner no different from an ordinary procedure call; then, a process is created to handle the invocation. The process may be created on the same processor or on another one, but this is transparent to the client which invokes the procedure and waits for it to return.

RPC vs Rendezvous RPC is different from a rendezvous because the latter involves the active participation of two processes in synchronous communications.

RPC vs Rendezvous To implement RPC, both the client and the server processes must be compiled with a remote interface containing common type and procedure declarations. The client process will invoke the procedures that are implemented in the server process

Channels Channels enable us to construct decentralized concurrent programs that do not necessarily share the same address space. Synchronous communication, where the sender and receiver wait for each other, is the basic form of synchronization, as it does not require design decisions about buffering.

Rendezvous and RPC More complex forms of communication, the rendezvous and the remote procedure call implemented in many systems, are used for higher-level synchronization, and are especially suited to client–server architectures.

Conclusions What is common to all the synchronization constructs studied so far is that they envision a set of processes executing more or less simultaneously. So, it makes sense to talk about one process blocking while waiting for the execution of a statement in another process.