Chapter 14 - 28 pages1 Distributed Process Management Chapter 14.

Slides:



Advertisements
Similar presentations
Chapter 7: Deadlocks.
Advertisements

Distributed Systems Major Design Issues Presented by: Christopher Hector CS8320 – Advanced Operating Systems Spring 2007 – Section 2.6 Presentation Dr.
Optimistic Methods for Concurrency Control By : H.T. Kung & John T. Robinson Presenters: Munawer Saeed.
Global States.
CS3771 Today: deadlock detection and election algorithms  Previous class Event ordering in distributed systems Various approaches for Mutual Exclusion.
Handling Deadlocks n definition, wait-for graphs n fundamental causes of deadlocks n resource allocation graphs and conditions for deadlock existence n.
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Virtual Time “Virtual Time and Global States of Distributed Systems” Friedmann Mattern, 1989 The Model: An asynchronous distributed system = a set of processes.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Chapter 7: Deadlocks.
Distributed Process Management
Chapter 18 Distributed Process Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Chapter 18 Distributed Process Management Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Distributed Databases John Ortiz. Lecture 24Distributed Databases2  Distributed Database (DDB) is a collection of interrelated databases interconnected.
Logical Time Each event is assigned a logical time from a totally ordered set T The logical times for the events must respect any possible dependencies.
Avishai Wool lecture Introduction to Systems Programming Lecture 5 Deadlocks.
Deadlocks CS 3100 Deadlocks1. The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held by another.
CS 582 / CMPE 481 Distributed Systems
Ordering and Consistent Cuts Presented By Biswanath Panda.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Distributed Snapshots –Termination detection Election algorithms –Bully –Ring.
Distributed Process Management
Deadlock CSCI 444/544 Operating Systems Fall 2008.
Witawas Srisa-an Chapter 6
20101 Synchronization in distributed systems A collection of independent computers that appears to its users as a single coherent system.
CPSC 4650 Operating Systems Chapter 6 Deadlock and Starvation
Chapter 18.2: Distributed Coordination Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 18 Distributed Coordination Chapter.
Chapter 18: Distributed Coordination (Chapter 18.1 – 18.5)
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 7: Deadlocks.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
1 Distributed Process Management: Distributed Global States and Distributed Mutual Exclusion.
PRASHANTHI NARAYAN NETTEM.
Distributed process management: Distributed deadlock
1 Distributed Systems: Distributed Process Management – Process Migration.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
CIS 720 Distributed algorithms. “Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint.
Concurrency: Deadlock and Starvation Chapter 6. Goal and approach Deadlock and starvation Underlying principles Solutions? –Prevention –Detection –Avoidance.
1 Concurrency: Deadlock and Starvation Chapter 6.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms –Bully algorithm.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
1 Distributed Process Management Chapter Distributed Global States Operating system cannot know the current state of all process in the distributed.
Presenter: Long Ma Advisor: Dr. Zhang 4.5 DISTRIBUTED MUTUAL EXCLUSION.
1 Chapter 10 Distributed Algorithms. 2 Chapter Content This and the next two chapters present algorithms designed for loosely-connected distributed systems.
Nov 8, 2003 SMU School of Engineering Group 2: Hammad, Mann, Nidgundi, & Zhang CSE 8343 Advanced Operating Systems Slide 1 Instructor: Dr. Khalil Distributed.
Politecnico di Milano © 2001 William Fornaciari Operating Systems Processor allocation in distributed systems Lecturer: William Fornaciari Politecnico.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Slide 10-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 10.
Chapter 7: Deadlocks. 7.2CSCI 380 – Operating Systems Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock Characterization Methods for Handling.
1 Chapter 11 Global Properties (Distributed Termination)
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Distributed Mutual Exclusion Synchronization in Distributed Systems Synchronization in distributed systems are often more difficult compared to synchronization.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
The Principles of Operating Systems Chapter 9 Distributed Process Management.
Distributed Systems Lecture 6 Global states and snapshots 1.
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
Synchronization: Distributed Deadlock Detection
Transaction Management
The Echo Algorithm The echo algorithm can be used to collect and disperse information in a distributed system It was originally designed for learning network.
Process Deadlocks.
Outline Distributed Mutual Exclusion Introduction Performance measures
Distributed Deadlock Detection
CSE 542: Operating Systems
Transactions, Properties of Transactions
Presentation transcript:

Chapter pages1 Distributed Process Management Chapter 14

Chapter pages2 Process Migration Move an active process from one machine to another The process migrates to a target machine Transferring a sufficient amount of the state of a process from one machine to another

Chapter pages3 Why Migrate? Load sharing move processes from heavily loaded to lightly load systems load can be balanced to improve overall performance Communications performance processes that interact intensively can be moved to the same node to reduce communications cost may be better to move process to where the data reside when the data is large

Chapter pages4 Why Migrate? Availability long-running process may need to move because the machine it is running on will be down Utilizing special capabilities process can take advantage of unique hardware or software capabilities

Chapter pages5 Initiation of Migration Operating system when goal is load balancing Process when goal is to reach a particular resource

Chapter pages6 What is Migrated? Must destroy the process on the source system Process control block and any links must be moved

Chapter pages7 What is Migrated? Eager (all):Transfer entire address space no trace of process is left behind if address space is large and if the process does not need most of it, then this approach my be unnecessarily expensive

Chapter pages8 What is Migrated Precopy: Process continues to execute on the source node while the address space is copied pages modified on the source during precopy operation have to be copied a second time reduces the time that a process is frozen and cannot execute during migration

Chapter pages9 What is Migrated? Eager (dirty): Transfer only that portion of the address space that is in main memory any additional blocks of the virtual address space are transferred on demand the source machine is involved throughout the life of the process good if process is temporarily going to another machine good for a thread since the threads left behind need the same address space

Chapter pages10 What is Migrated? Copy-on-reference: Pages are only brought over on reference variation of eager (dirty) has lowest initial cost of process migration

Chapter pages11 What is Migrated? Flushing: Pages are cleared from main memory by flushing dirty pages to disk later use copy-on-reference strategy relieves the source of holding any pages of the migrated process in main memory

Chapter pages12 Negotiation of Process Migration Starter 1: Will you take P? 2: Yes, migrate to machine 3 3: MigrateOut P 4: Offer P 7: Accept offer 5: Offer P 6: MigrateIn P A P B KJ SD

Chapter pages13 Distributed Global States Operating system cannot know the current state of all process in the distributed system A process can only know the current state of all processes on the local system Remote processes only know state information that is received by messages these messages represent the state in the past

Chapter pages14 Example Bank account is distributed over two branches The total amount in the account is the sum at each branch At 3 PM the account balance is determined Messages are sent to request the information

Chapter pages15 Example Branch A Branch B 3:00 Total = $ S A = $ S B = $0.00

Chapter pages16 Example If at the time of balance determination, the balance from branch A is in transit to branch B The result is a false reading

Chapter pages17 Example Branch A Branch B 3:00 Total = $0.00 S A = $0.00 S B = $0.00 msg = “Transfer $100 to Branch B” 2:59 3:01

Chapter pages18 Example All messages in transit must be examined at time of observation Total consists of balance at both branches and amount in message

Chapter pages19 Example If clocks at the two branches are not perfectly synchronized Transfer amount at 3:01 from branch A Amount arrives at branch B at 2:59 At 3:00 the amount is counted twice

Chapter pages20 Example Branch A Branch B Total = $ S A = $ S B = $ :003:01 2:59 3:00 msg = “Transfer $100 to Branch B”

Chapter pages21 Example of a Snapshot Process 1 Outgoing channels 2 sent 1,2,3,4,5,6 3 sent 1,2,3,4,5,6 Incoming channels Process 2 Outgoing channels 3 sent 1,2,3,4 4 sent 1,2,3,4 Incoming channels 1 received 1,2,3,4 stored 5,6 3 received 1,2,3,4,5,6,7,8 Process 3 Outgoing channels 2 sent 1,2,3,4,5,6,7,8 Incoming channels 1 received 1,2,3 stored 4,5,6 2 received 1,2,3 stored 4 4 received 1,2,3 Process 4 Outgoing channels 3 sent 1,2,3 Incoming channels 2 received 1,2 stored 3,4

Chapter pages22 Ordering of Events Events must be order to ensure mutual exclusion and avoid deadlock Clocks are not synchronized Communication delays State information for a process is not up to date

Chapter pages23 Ordering of Events Need to consistently say that one event occurs before another event Messages are sent when want to enter critical section and when leaving critical section Time-stamping orders events on a distributed system system clock is not used

Chapter pages24 Time-Stamping Each system on the network maintains a counter which functions as a clock Each site has a numerical identifier When a message is received, the receiving system sets is counter to one more than the maximum of its current value and the incoming time-stamp (counter)

Chapter pages25 Time-Stamping If two messages have the same time- stamp, they are ordered by the number of their sites For this method to work, each message is sent from one process to all other processes ensures all sites have same ordering of messages for mutual exclusion and deadlock all processes must be aware of the situation

Chapter pages26 Token-Passing Algorithm if not token_present then begin clock := clock + 1;Prelude broadcast(Request, clock I); wait(access, token); token_present := True; end endif; token_held := True: token(i) := clock;Postlude token_head := False; for j := i + 1 to n, 1 to i - 1 do if (request(j) > token(J)) [Symbol]^token_present then begin token_present := False; send(access, token(j)) end endif; when received (Request, k, j) doNotation: request(j) := max(request(j), k); send(j, access, token)send message of type access, with token, by process j if token_present[Symbol]Ynot token_held then broadcast(request, clock, i) send message from process i of type request, with timestamp clock, to all other processes endif received(request, t, j)receive message from process j of type request, enddo; with timestamp t

Chapter pages27 Distributed Deadlock Detection Algorithm {Date object Dj receiving a lock_request(Ti)} begin if Locked_by(Dj) = nil then send granted else begin send not granted to Ti; send Locked)by(Dj) to Ti end end. {Transaction Ti makes a lock request for data object Dj} begin send lock_request(Ti) to Dj; wait for granted/not granted; if granted then begin Locked_by(Dj) := Ti; Held_by(Ti) :=  end else {suppose Dj is being used by transaction Tj} begin Held_by(Ti) := Tj; Enqueue(Ti, Request_Q(Tj)); if Wait_for(Tj) = nil then Wait_for(Ti) := Tj else Wait_for(Ti) := Wait_for(Tj); update(Wait)for(Ti), Request_Q(Ti)) end end. {Transaction Tj receiving update message} begin if Wait_for(Tj)  Wait_for(Ti) then Wait_for(Tj) := Wait_for(Ti); if Wait_for(Tj)  Request_Q(Tj) = nil then update(Wait_for(Ti), Request_Q(Tj)) else begin DECLARE DEADLOCK; {initiate deadlock resolution as follows} {Tj is chosen as the transaction to be aborted} {Tj releases all the data objects it holds} send clear(Tj, Held_by(Tj)); allocate each data object Di held by Tj to the first requester Tk in Request_Q(Tj); for every transaction Tn in Request_Q(Tj) requesting data object Di held by Tj do Enqueue(Tn, Request_Q(Tk)); end end. {Transaction Tk receiving a clear(Tj, Tk) message begin purge the tuple having Tj as the requesting transaction from Request_Q(Tk) end.

Chapter pages28 Example of Distributed Deadlock Algorithm T5T5 T1T1 T2T2 T3T3 T4T4 T6T6 T0T0 T5T5 T1T1 T2T2 T3T3 T4T4 T6T6 T0T0