Coupling Thursday, October 21, :23 PM

Similar documents
Threads Tuesday, September 28, :37 AM

Concurrency: Deadlock and Starvation

CSE 153 Design of Operating Systems

Chapter 5 Concurrency: Mutual Exclusion and Synchronization

IT 540 Operating Systems ECE519 Advanced Operating Systems

Concurrency, Mutual Exclusion and Synchronization C H A P T E R 5

Recall from deadlock lecture. Tuesday, October 18, 2011

Chapter 5 Concurrency: Mutual Exclusion. and. Synchronization. Operating Systems: Internals. and. Design Principles

CS 31: Intro to Systems Misc. Threading. Kevin Webb Swarthmore College December 6, 2018

Distributed Systems. coordination Johan Montelius ID2201. Distributed Systems ID2201

Suggested Solutions (Midterm Exam October 27, 2005)

Resource management. Real-Time Systems. Resource management. Resource management

Coordination and Agreement

Operating Systems (234123) Spring (Homework 3 Wet) Homework 3 Wet

Operating Systems. Lecture 4 - Concurrency and Synchronization. Master of Computer Science PUF - Hồ Chí Minh 2016/2017

Tasks. Task Implementation and management

CS 318 Principles of Operating Systems

CSE 5306 Distributed Systems. Synchronization

Operating Systems: William Stallings. Starvation. Patricia Roy Manatee Community College, Venice, FL 2008, Prentice Hall

CS 153 Design of Operating Systems Winter 2016

Real-Time Systems. Lecture #4. Professor Jan Jonsson. Department of Computer Science and Engineering Chalmers University of Technology

ZooKeeper & Curator. CS 475, Spring 2018 Concurrent & Distributed Systems

Event Ordering. Greg Bilodeau CS 5204 November 3, 2009

Deadlock. Concurrency: Deadlock and Starvation. Reusable Resources

Part II Process Management Chapter 6: Process Synchronization

More Types of Synchronization 11/29/16

Concurrent Programming

Secure Software Programming and Vulnerability Analysis

Page 104, Problem 2.4. Page 104, Problem 2.4

Introduction to Real-Time Operating Systems

Epilogue. Thursday, December 09, 2004

740: Computer Architecture Memory Consistency. Prof. Onur Mutlu Carnegie Mellon University

Distributed Coordination with ZooKeeper - Theory and Practice. Simon Tao EMC Labs of China Oct. 24th, 2015

Threading and Synchronization. Fahd Albinali

Large Systems: Design + Implementation: Communication Coordination Replication. Image (c) Facebook

Chapter 6 Concurrency: Deadlock and Starvation

Message Passing Models and Multicomputer distributed system LECTURE 7

Distributed Operating Systems. Distributed Synchronization

POSIX / System Programming

MULTITHREADING AND SYNCHRONIZATION. CS124 Operating Systems Fall , Lecture 10

MultiJav: A Distributed Shared Memory System Based on Multiple Java Virtual Machines. MultiJav: Introduction

Lecture 7: Logical Time

CSE 4/521 Introduction to Operating Systems. Lecture 24 I/O Systems (Overview, Application I/O Interface, Kernel I/O Subsystem) Summer 2018

CSE 5306 Distributed Systems

Parallel Processing: Performance Limits & Synchronization

SYNCHRONIZATION M O D E R N O P E R A T I N G S Y S T E M S R E A D 2. 3 E X C E P T A N D S P R I N G 2018

Processor speed. Concurrency Structure and Interpretation of Computer Programs. Multiple processors. Processor speed. Mike Phillips <mpp>

Concurrent Programming. CS105 Programming Languages Supplement

Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions

Module 1. Introduction:

CSE 153 Design of Operating Systems

Operating Systems 2010/2011

Process. Program Vs. process. During execution, the process may be in one of the following states

Bull. HACMP 4.4 Programming Locking Applications AIX ORDER REFERENCE 86 A2 59KX 02

Architectural Support. Processes. OS Structure. Threads. Scheduling. CSE 451: Operating Systems Spring Module 28 Course Review

Parallel And Distributed Compilers

QUESTION BANK UNIT I

Distributed Mutual Exclusion

Dr. D. M. Akbar Hussain DE5 Department of Electronic Systems

EE/CSCI 451: Parallel and Distributed Computation

Midterm Exam. October 20th, Thursday NSC

CSE 486/586 Distributed Systems

Verteilte Systeme (Distributed Systems)

Synchronization II: EventBarrier, Monitor, and a Semaphore. COMPSCI210 Recitation 4th Mar 2013 Vamsi Thummala

Page 1. Analogy: Problems: Operating Systems Lecture 7. Operating Systems Lecture 7

Frequently asked questions from the previous class survey

Programming in Parallel COMP755

Executive Summary. It is important for a Java Programmer to understand the power and limitations of concurrent programming in Java using threads.

Last Class: Monitors. Real-world Examples

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

Real-Time Programming

Operating Systems (1DT020 & 1TT802)

Lecture 9: Midterm Review

CSE 153 Design of Operating Systems Fall 2018

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 21: Network Protocols (and 2 Phase Commit)

IPC and Unix Special Files

CS 31: Introduction to Computer Systems : Threads & Synchronization April 16-18, 2019

Embedded Systems. 6. Real-Time Operating Systems

Module 12: I/O Systems

MULTIPROCESSORS AND THREAD-LEVEL. B649 Parallel Architectures and Programming

Synchronization. CS61, Lecture 18. Prof. Stephen Chong November 3, 2011

MULTIPROCESSORS AND THREAD-LEVEL PARALLELISM. B649 Parallel Architectures and Programming

More on Synchronization and Deadlock

Chapter 5 Asynchronous Concurrent Execution

Process Synchronization

Multiprocessors 2007/2008

Sistemas Operacionais I. Valeria Menezes Bastos

RCU. ò Walk through two system calls in some detail. ò Open and read. ò Too much code to cover all FS system calls. ò 3 Cases for a dentry:

MULTIPROCESSORS. Characteristics of Multiprocessors. Interconnection Structures. Interprocessor Arbitration

read(2) There can be several cases where read returns less than the number of bytes requested:

Synchronization. Chapter 5

殷亚凤. Synchronization. Distributed Systems [6]

VFS, Continued. Don Porter CSE 506

IV. Process Synchronisation

Concurrency - Topics. Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads

CMSC Computer Architecture Lecture 12: Multi-Core. Prof. Yanjing Li University of Chicago

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

Operating Systems Antonio Vivace revision 4 Licensed under GPLv3

CSE 410 Final Exam Sample Solution 6/08/10

Interprocess Communication By: Kaushik Vaghani

Transcription:

Coupling Page 1 Coupling Thursday, October 21, 2004 3:23 PM Two kinds of multiple-processor systems Tightly-coupled Can share efficient semaphores. Usually involve some form of shared memory. Loosely-coupled Processes use processors with independent memory. Semaphores are slow.

Message-passing One process "sends" a message to another. Two primitives "send" and "recv". Send: send a message to a process or group of processes. Recv: receive a message from a process. "mailbox": buffer that can be sent to or received from. Primitives Create mailbox Delete mailbox Send to mailbox Receive from mailbox Coupling Page 2

Coupling Page 3

Coupling Page 4

Coupling Page 5

Coupling Page 6

Coupling Page 7

Coupling Page 8 Time has no meaning in a distributed system: clock drift means that no clocks will agree. No sense of time, only precedence.

Coupling Page 9 Multiple sends Mailboxes must be queues, or sends will block.

Coupling Page 10 Synchronization: "Brain-dead sync": semaphore is reactive process Notes: Semaphore is single-threaded daemon Queues requests; acts in order of receipt Requires queue for strong behavior

Coupling Page 11 Aside: we are not far from creating a database server here. basic thing that a database server provides: atomicity over distributed operations. serialization: queues into some (random) order, plays back requests in serial stream. only difference between lock server and db server is complexity of queries.

Coupling Page 12 Network Semaphore Properties Queues (serialized FIFO) Slow (waits for ACK) Lots of communications.

Coupling Page 13 Good and bad news Good news: can construct semaphores from message-passing. Bad news: it's reallllly slow.

Coupling Page 14 Kinds of message-passing Blocking send and receive Sender doesn't block, receiver blocks. (normal) (annoying: sends are asynchronous, process won't die until it's done with them) Neither blocks

Coupling Page 15 Synchronization Thursday, October 21, 2004 3:26 PM Generally, no form of "tight" synchronization for processes in a loosly coupled environment. Clocks don't agree. Messages take unknown time to travel. New "loose" form of synchronization: "barriers". A group of processes waits till all are in desirable states. Implementable via message-passing.

Key to synchronization: A message receipt is a synchronization event. It says that the process that sent the message is now in a specific state. Coupling Page 16

Example of barrier synchronization Coupling Page 17

Optimal barrier sync (lowest network overhead without broadcast) Arrange nodes into a tree "collect" responses from children One node (root) gets all responses Root forwards responses to all descendants Coupling Page 18

Coupling Page 19 Network resource sharing Thursday, October 21, 2004 3:29 PM Network resource sharing Locking daemons Distributed voting

Coupling Page 20 Locking daemons Thursday, October 21, 2004 3:30 PM Locking daemons Create an artificial domain of atomicity by creating a resource for which one must wait. Implicitly serialize resource requests. If applications do not proceed until they are granted a lock, then their operations are atomic (within the set of cooperating processes sharing a lockable resource). Caveat: participation is voluntary.

Coupling Page 21 Common daemons with atomicity properties Database servers. Object servers ("web services") File servers (e.g., NFS lockd) Common daemons without atomicity properties Web servers Session servers (e.g., sshd)

Coupling Page 22

Coupling Page 23 File sharing Thursday, October 21, 2004 3:43 PM Problem of file sharing: what is exclusive access? int fd = open("/g/111/class/a2/t2.o", O_EXCL O_CREAT O_WRONLY); // exclusive write O_WRONLY: open for writing O_CREAT: create if not present O_EXCL: fail if other processes have it open. Same problems all over again: Readers/writers races. Deadlock waiting for resources to be allocated. Catch: this file cannot be local. It's on a file server (netapp01) how to make this "predictable". what's reasonable?

Coupling Page 24 Local domain: global knowledge of file descriptors Can serialize writes in the kernel. Network file system: No global knowledge of file descriptors. No good knowledge of race competitors. asynchronous No way for kernel to serialize creat is not atomic without another mechanism to assure it.

Coupling Page 25

Coupling Page 26 Summary Monday, October 24, 2005 4:36 PM Kernel serializes local requests On network, no concept of serial kernel => no intrinsic ability to serialize. Relying upon locking daemons (essentially glorified semaphores in network domain) provides serialization that kernel provided before.