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

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

Multiple Processor Systems
Categories of I/O Devices
INPUT-OUTPUT ORGANIZATION
Executional Architecture
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
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.
Multiple Processor Systems
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.
Informationsteknologi Wednesday, September 26, 2007 Computer Systems/Operating Systems - Class 91 Today’s class Mutual exclusion and synchronization 
Introduction in algorithms and applications Introduction in algorithms and applications Parallel machines and architectures Parallel machines and architectures.
CS 584. A Parallel Programming Model We need abstractions to make it simple. The programming model needs to fit our parallel machine model. Abstractions.
CS533 - Concepts of Operating Systems 1 Remote Procedure Calls - Alan West.
Remote Procedure Call in SR Programming Language By Tze-Kin Tsang 3/20/2000.
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.
ITERATIVE COMPUTATIONS CONCURRENCY ID1218 Lecture Christian Schulte Software and Computer Systems School of Information and.
Asynchronous Message Passing EE 524/CS 561 Wanliang Ma 03/08/2000.
1 Chapter 4 Threads Threads: Resource ownership and execution.
1 I/O Management in Representative Operating Systems.
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.
INPUT-OUTPUT ORGANIZATION
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.
Chapter 9 Message Passing Copyright © Operating Systems, by Dhananjay Dhamdhere Copyright © Operating Systems, by Dhananjay Dhamdhere2 Introduction.
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.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Problems with Send and Receive Low level –programmer is engaged in I/O –server often not modular –takes 2 calls to get what you want (send, followed by.
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
Dr. John P. Abraham Professor University of Texas Pan American Internet Applications and Network Programming.
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.
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.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
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
Real-Time Systems Lecture 5 Lärare: Olle Bowallius Telefon: Anders Västberg Telefon:
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Last Class: Introduction
Chapter 3: Process Concept
“Language Mechanism for Synchronization”
Chapter 3 Internet Applications and Network Programming
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Sarah Diesburg Operating Systems COP 4610
What is Concurrent Programming?
Channels.
What is Concurrent Programming?
Subject : T0152 – Programming Language Concept
Computer Science 312 Concurrent Programming I Processes and Messages 1.
Channels.
Channels.
Presentation transcript:

Channels

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

Addressing Symmetric 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 loop forever q1: ch ⇒ y q2: consume(y)

Comway’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

(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 X

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.

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.