DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 3 Processes

Similar documents
Distributed Systems Principles and Paradigms

Distributed Information Processing

殷亚凤. Processes. Distributed Systems [3]

Distributed Systems. Edited by. Ghada Ahmed, PhD. Fall (3rd Edition) Maarten van Steen and Tanenbaum

Dr Markus Hagenbuchner CSCI319. Distributed Systems Chapter 3 - Processes

Verteilte Systeme (Distributed Systems)

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Chapter 10 DISTRIBUTED OBJECT-BASED SYSTEMS

Distributed Systems COMP 212. Lecture 18 Othon Michail

Operating System. Chapter 4. Threads. Lynn Choi School of Electrical Engineering

Motivation. Threads. Multithreaded Server Architecture. Thread of execution. Chapter 4

Process Description and Control

Types of Virtualization. Types of virtualization

Processes & Threads. Recap of the Last Class. Layered Structure. Virtual Machines. CS 256/456 Dept. of Computer Science, University of Rochester

OPERATING SYSTEM. Chapter 4: Threads

Processes & Threads. Recap of the Last Class. Microkernel System Architecture. Layered Structure

Lecture 5: Process Description and Control Multithreading Basics in Interprocess communication Introduction to multiprocessors

Process Characteristics

Distributed File Systems Issues. NFS (Network File System) AFS: Namespace. The Andrew File System (AFS) Operating Systems 11/19/2012 CSC 256/456 1

Chapter 4: Threads. Chapter 4: Threads. Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues

DISTRIBUTED COMPUTER SYSTEMS

OS Virtualization. Linux Containers (LXC)

CS5460: Operating Systems

Chapter 3 Process Description and Control

Module 1: Virtualization. Types of Interfaces

Distributed System: Definition

Chapter 7 Consistency And Replication

Module 4: Processes. Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess Communication

Module 4: Processes. Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess Communication

Questions answered in this lecture: CS 537 Lecture 19 Threads and Cooperation. What s in a process? Organizing a Process

Agenda. Threads. Single and Multi-threaded Processes. What is Thread. CSCI 444/544 Operating Systems Fall 2008

Threads, SMP, and Microkernels. Chapter 4

Agenda Process Concept Process Scheduling Operations on Processes Interprocess Communication 3.2

Implementation of Processes

Data Centers and Cloud Computing

Data Centers and Cloud Computing. Slides courtesy of Tim Wood

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 7 Consistency And Replication

Data Centers and Cloud Computing. Data Centers

Distributed Systems Operation System Support

Processes and More. CSCI 315 Operating Systems Design Department of Computer Science

Chapter 4: Threads. Operating System Concepts 8 th Edition,

Chapter 4: Threads. Chapter 4: Threads

Cloud Computing Chapter 2

Processes and Threads

For use by students enrolled in #71251 CSE430 Fall 2012 at Arizona State University. Do not use if not enrolled.

Process Characteristics. Threads Chapter 4. Process Characteristics. Multithreading vs. Single threading

Threads Chapter 4. Reading: 4.1,4.4, 4.5

Threads Chapter 5 1 Chapter 5

Threads, SMP, and Microkernels

Preview. The Thread Model Motivation of Threads Benefits of Threads Implementation of Thread

Applications, services. Middleware. OS2 Processes, threads, Processes, threads, communication,... communication,... Platform

SMD149 - Operating Systems

Processes and Threads Implementation

MICROKERNEL CONSTRUCTION 2014

24-vm.txt Mon Nov 21 22:13: Notes on Virtual Machines , Fall 2011 Carnegie Mellon University Randal E. Bryant.

یس تاروتسد (تاروتسد زا

Lecture 7: February 10

Chapter 2 ARCHITECTURES

Chapter 4 Threads, SMP, and

Chapter 4: Threads. Operating System Concepts 9 th Edit9on

CS 475. Process = Address space + one thread of control Concurrent program = multiple threads of control

CS 550 Operating Systems Spring Introduction to Virtual Machines

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

Table of Contents DevOps Administrators

Virtual Machines. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Threads. CS-3013 Operating Systems Hugh C. Lauer. CS-3013, C-Term 2012 Threads 1

Chapter 3 Parallel Software

Operating System Control Structures

CHAPTER 3 - PROCESS CONCEPT

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 1. Introduction

Operating Systems 2 nd semester 2016/2017. Chapter 4: Threads

Operating System Security

Yi Shi Fall 2017 Xi an Jiaotong University

02 - Distributed Systems

Frequently asked questions from the previous class survey

Chapter 4: Processes. Process Concept

Threads. Raju Pandey Department of Computer Sciences University of California, Davis Spring 2011

Today s Topics. u Thread implementation. l Non-preemptive versus preemptive threads. l Kernel vs. user threads

Jan 20, 2005 Lecture 2: Multiprogramming OS

Chapter 11 DISTRIBUTED FILE SYSTEMS

Chapter 4: Processes

Operating Systems Overview. Chapter 2

Windows 7 Overview. Windows 7. Objectives. The History of Windows. CS140M Fall Lake 1

Threads. CSE 410, Spring 2004 Computer Systems.

Multiprocessor Scheduling. Multiprocessor Scheduling

Table of Contents 1.1. Introduction. Overview of vsphere Integrated Containers 1.2

Chapter 4: Multithreaded Programming

CSE 4/521 Introduction to Operating Systems

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

Processes & Threads. Process Management. Managing Concurrency in Computer Systems. The Process. What s in a Process?

Service and Cloud Computing Lecture 10: DFS2 Prof. George Baciu PQ838

Distributed Systems. Thoai Nam Faculty of Computer Science and Engineering HCMC University of Technology

Motivation of Threads. Preview. Motivation of Threads. Motivation of Threads. Motivation of Threads. Motivation of Threads 9/12/2018.

Operating System. Operating System Overview. Structure of a Computer System. Structure of a Computer System. Structure of a Computer System

CS533 Concepts of Operating Systems. Jonathan Walpole

Operating Systems: Internals and Design Principles. Chapter 4 Threads Seventh Edition By William Stallings

University of Alberta. Zhu Pang. Master of Science. Department of Computing Science

Processes and Threads Implementation

Learning Outcomes. Processes and Threads Implementation. Processes Process s user-level stack and execution state. Threads The Thread Model.

Process Description and Control

Transcription:

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN Chapter 3 Processes

Context Switching Processor context: The minimal collection of values stored in the registers of a processor used for the execution of a series of instructions (e.g., stack pointer, addressing registers, program counter). Thread context: The minimal collection of values stored in registers and memory, used for the execution of a series of instructions (i.e., processor context, state). Process context: The minimal collection of values stored in registers and memory, used for the execution of a thread (i.e., thread context, but now also at least MMU register values).

Observations on Context Switching 1. Threads share the same address space. Thread context switching can be done entirely independent of the operating system. 2. Process switching is generally (somewhat) more expensive as it involves getting the OS in the loop, i.e., trapping to the kernel. 3. Creating and destroying threads is much cheaper than doing so for processes.

Why use threads 1. Avoid needless blocking: a single-threaded process will block when doing I/O; in a multi-threaded process, the operating system can switch the CPU to another thread in that process. 2. Exploit parallelism: the threads in a multi-threaded process can be scheduled to run in parallel on a multiprocessor or multicore processor. 3. Avoid process switching: structure large applications not as a collection of processes, but through multiple threads.

Thread Usage in Nondistributed Systems Figure 3-1. Context switching as the result of IPC.

Thread Implementation User-level thread Cheap to Create and Destroy threads. Switching context can be done in few instructions. Invocation of blocking system call will immediately block the entire process. Kernel-level thread: High price to pay. Every thread operation carried out by kernel requiring a system call. Switching contexts may now become as expensive as switching process context. Hybrid form of user-level and kernel-level threads. Lightweight Processes (LWP)

Thread Implementation Figure 3-2. Combining kernel-level lightweight processes and user-level threads.

Multi-threaded Clients

Multithreaded Servers (1)

Multithreaded Servers (2) Figure 3-4. Three ways to construct a server.

The Role of Virtualization in Distributed Systems Figure 3-5. (a) General organization between a program, interface, and system. (b) General organization of virtualizing system A on top of system B.

Mimicking Interfaces Four types of interfaces at three different levels 1.Instruction set architecture: the set of machine instructions, with two subsets: I. Privileged instructions: allowed to be executed only by the operating system. II. General instructions: can be executed by any program. 2.System calls as offered by an operating system. 3.Library calls, known as an application programming interface (API)

Architectures of Virtual Machines

Runtime (process) VM

Native VM monitor

Hosted VM Monitor

VMs and cloud computing Three types of cloud services Infrastructure-as-a-Service covering the basic infrastructure Platform-as-a-Service covering system-level services Software-as-a-Service containing actual applications IaaS Instead of renting out a physical machine, a cloud provider will rent out a VM (or VMM) may possibly be sharing a physical machine with other customers almost complete isolation between customers (although performance isolation may not be reached).

Networked User Interfaces (1) A networked application with its own protocol.

Networked User Interfaces (2) Figure 3-8. (b) A general solution to allow access to remote applications.

Example: The XWindow System Figure 3-9. The basic organization of thexwindow System.

Improving X There is often no clear separation between application logic and user-interface commands Applications tend to operate in a tightly synchronous manner with an X Kernel Alternative approaches Let applications control the display completely, up to the pixel level (e.g., VNC) Provide only a few high-level display operations (dependent on local video drivers), allowing more efficient display operations.

Client-Side Software for Distribution Transparency Figure 3-10. Transparent replication of a server using a client-side solution.

General Design Issues (1) Figure 3-11. (a) Client-to-server binding using a daemon.

General Design Issues (2) Figure 3-11. (b) Client-to-server binding using a superserver.

Server Interrupt 1) Close the screen 2) Out-of-band data: 1) On out of band channel: FTP control channel 2) On the same channel: urgent data

Server state 1. Stateless server: like HTTP server 2. Soft state: it keeps information for limited time only, like user updates 3. State full state: it keeps the user information indefinitely. Like Google drive.

Server Clusters (1) Figure 3-12. The general organization of a three-tiered server cluster.

Request Handling Figure 3-13. The principle of TCP handoff.

Distributed Servers Figure 3-14. Route optimization in a distributed server.

Managing Server Clusters Example: PlanetLab Essence of PlanetLab: Different organizations contribute machines, which they subsequently share for various experiments. We need to ensure that different distributed applications do not get into each other s way virtualization

PlanetLab (1) PlanetLab management issues: Nodes belong to different organizations. Each organization should be allowed to specify who is allowed to run applications on their nodes, And restrict resource usage appropriately. Monitoring tools available assume a very specific combination of hardware and software. All tailored to be used within a single organization. Programs from different slices but running on the same node should not interfere with each other.

Reasons for Migrating Code Figure 3-17. The principle of dynamically configuring a client to communicate to a server. The client first fetches the necessary software, and then invokes the server.

Models for Code Migration Figure 3-18. Alternatives for code migration.

Migration and Local Resources Figure 3-19. Actions to be taken with respect to the references to local resources when migrating code to another machine.

Migration in Heterogeneous Systems Three ways to handle migration (which can be combined) Pushing memory pages to the new machine and resending the ones that are later modified during the migration process. Stopping the current virtual machine; migrate memory, and start the new virtual machine. Letting the new virtual machine pull in new pages as needed, that is, let processes start on the new virtual machine immediately and copy memory pages on demand.

PlanetLab (2) Figure 3-16. The management relationships between various PlanetLab entities.

PlanetLab (3) Relationships between PlanetLab entities: A node owner puts its node under the regime of a management authority, possibly restricting usage where appropriate. A management authority provides the necessary software to add a node to PlanetLab. A service provider registers itself with a management authority, trusting it to provide wellbehaving nodes.

PlanetLab (4) Relationships between PlanetLab entities: A service provider contacts a slice authority to create a slice on a collection of nodes. The slice authority needs to authenticate the service provider. A node owner provides a slice creation service for a slice authority to create slices. It essentially delegates resource management to the slice authority. A management authority delegates the creation of slices to a slice authority.