CS444/CS544 Operating Systems Atomic Transactions 3/26/2007 Prof. Searleman

Slides:



Advertisements
Similar presentations
Deadlocks pp System Model 1.Request 2.Use 3.Release Necessary Conditions 1.Mutual exclusion (non-sharable) 2.Hold and wait (holding at least one.
Advertisements

Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
1 CSIS 7102 Spring 2004 Lecture 8: Recovery (overview) Dr. King-Ip Lin.
CMPT 401 Summer 2007 Dr. Alexandra Fedorova Lecture X: Transactions.
Database Systems, 8 th Edition Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces explicit.
Deadlocks Andy Wang Operating Systems COP 4610 / CGS 5765.
Chapter 7 Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 14, 2005 Chapter 7: Deadlocks 7.1 System Model.
Avishai Wool lecture Introduction to Systems Programming Lecture 5 Deadlocks.
Deadlock Chapter 3 R1 R2 P2P1 Allocated Requested.
CMPT Dr. Alexandra Fedorova Lecture X: Transactions.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 8: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks.
Deadlocks. 2 System Model There are non-shared computer resources –Maybe more than one instance –Printers, Semaphores, Tape drives, CPU Processes need.
Chapter 15 Transaction Management. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Transaction basics Concurrency.
Chapter 7: Deadlocks. 7.2 Chapter Objectives To develop a description of deadlocks, which prevent sets of concurrent processes from completing their tasks.
1 Chapter 7: Deadlock. 2 The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance.
Deadlock CSCI 444/544 Operating Systems Fall 2008.
CS444/CS544 Operating Systems Atomic Transactions 3/14/2007 Prof. Searleman
1 Lecture 8: Deadlocks Operating System Spring 2008.
Deadlocks. 2 Deadlock Avoidance If we have future information –Max resource requirement of each process before they execute Can we guarantee that deadlocks.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 7: Deadlocks.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Transaction. A transaction is an event which occurs on the database. Generally a transaction reads a value from the database or writes a value to the.
Transactions and Recovery
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Deadlocks.
CS444/CS544 Operating Systems Deadlock 3/07/2006 Prof. Searleman
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
Cosc 4740 Chapter 6, Part 4 Deadlocks. The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held.
II.I Selected Database Issues: 2 - Transaction ManagementSlide 1/20 1 II. Selected Database Issues Part 2: Transaction Management Lecture 4 Lecturer: Chris.
The Relational Model1 Transaction Processing Units of Work.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 7: Deadlocks.
Real-time Databases Presented by Parimala kyathsandra CSE 666 fall 2006 Instructor Prof. Subra ganesan.
CS6502 Operating Systems - Dr. J. Garrido Deadlock – Part 2 (Lecture 7a) CS5002 Operating Systems Dr. Jose M. Garrido.
Chapter 7 Deadlocks Page 2 Chapter 7: Deadlocks System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance.
Transaction Management Transparencies. ©Pearson Education 2009 Chapter 14 - Objectives Function and importance of transactions. Properties of transactions.
Deadlocks System Model RAG Deadlock Characterization
Chapter 7 Deadlocks Chapter 7: Deadlocks 7.1 System Model 7.2 Deadlock Characterization 7.3 Methods for Handling Deadlocks 7.4 Deadlock Prevention 7.5.
Chapter 8 Deadlocks. Objective System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 6 Deadlocks Slide 1 Chapter 6 Deadlocks.
Deadlocks - System Model - Deadlock characterization - Methods for handling deadlocks - Deadlock prevention,avoidance - Deadlock detection and recovery.
Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 7: Deadlocks.
SYSTEMS IMPLEMENTATION TECHNIQUES TRANSACTION PROCESSING DATABASE RECOVERY DATABASE SECURITY CONCURRENCY CONTROL.
Chapter 7: Deadlocks. 7.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 7: Deadlocks The Deadlock Problem System Model Deadlock.
Deadlocks Lots of resources can only be used by one process at a time. Exclusive access is needed. Suppose process A needs R1 + R2 and B needs R1 + R2.
OPERATING SYSTEM CONCEPTS AND PRACTISE
Process Management Deadlocks.
Transaction Management
Concurrency: Deadlock and Starvation
Chapter 12: Concurrency, Deadlock and Starvation
Operating Systems (CS 340 D)
Chapter 7: Deadlocks.
Advanced Operating System Fall 2009
Chapter 7 Deadlocks.
Process Deadlocks.
Chapter 10 Transaction Management and Concurrency Control
Chapter 7: Deadlocks.
G.Anuradha Ref:- Galvin
Chapter 7: Deadlocks.
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Andy Wang Operating Systems COP 4610 / CGS 5765
Lecture 20: Intro to Transactions & Logging II
Deadlocks Session - 13.
CSE 542: Operating Systems
CSE 542: Operating Systems
Chapter 8: Deadlocks Deadlock Characterization
Deadlock CSE 2431: Introduction to Operating Systems
Transactions, Properties of Transactions
Presentation transcript:

CS444/CS544 Operating Systems Atomic Transactions 3/26/2007 Prof. Searleman

Outline Return & discuss Exam#2 Deadlock Atomic Transactions NOTE: Read: Chapter 8 HW#9 posted, Friday, 3/30 HW#9

Recap: Banker’s Algorithm ResourceABC Total #1057 Available332 Current Allocation ABC p0010 p1200 p2302 p3211 p4002 Still Needs ABC p0743 p1122 p2600 p3011 p4431 Maximum Demand ABC If a process requests some resources, determine 1. are there enough resources currently available? 2. if so, does it leave the system in a “safe state”?

P1 requests (1, 0, 2). Available (3, 3, 2) AVAILABLEALLOCATION p4 runs & requests (4, 3, 1)(3, 1, 2)p4 has (4, 3, 3) p3 completes & releases all(7, 4, 3) p1 granted (1,0,2)(2, 3, 0)p1 has (1, 1, 2) p1 runs & requests (0,2,0)(2, 1, 0)p1 has (3, 2, 2) p1 completes & releases all(5, 3, 2) p3 runs & requests (0,1,1)(5, 2, 1)p3 has (2, 2, 2)) p4 completes & releases all(7, 4, 5) p0 runs & requests (7, 4, 3)(0, 0, 2)p0 has (7, 5, 3) p0 completes & releases all(7, 5, 5) p2 runs & requests (6, 0, 0)(1, 5, 5)p2 has (9, 0, 2) p2 completes & releases all(10, 5, 7)

Recap: Banker’s Algorithm Note: “unsafe state” ≠ “deadlocked state” p0 can still run, and it might release some resources. Or it might never ask for its maximum demand. But you can’t guarantee that deadlock won’t occur. => Banker’s Algorithm is conservative

Recap: Deadlock detection & recovery How often to run the detection algorithm? How often is deadlock likely to occur? How many processes will be affected? When CPU utilization drops below X%? If system detects deadlock, what can it do to break the deadlock? What do people do after manual detection? Kill a process (es) Pi s.t. canFinish[i] == FALSE Reboot the system

Real life? Most used prevention technique is resource ordering – reasonable for programmers to attempt Avoidance and Detection too expensive Most systems use manual detection and recovery My process is hung – kill process My machine is locked up – reboot Write code that deadlocks and run it on Linux and on Windows – what happens?

Recap: Atomic Transactions A transaction is a collection of instructions (or operations) that perform a single logical function. Introduce concept of commit (or save) at the end of a transaction Until commit, all the individual operations that make up the transaction are pending At any point before the transaction is committed, it might also be aborted If a transaction is aborted, the system will undo or rollback the effects of any individual operations which have completed

ACID properties of Transactions (A)tomicity Happen as a unit – all of nothing (C)onsistency Integrity constraints on data are maintained (I)solation Other transactions cannot see or interfere with the intermediate stages of a transaction (D)urability Committed changes are reflected in the data permanently even in the face of failures in the system Atomicity, consistency and isolation are all the result of synchronization among transactions like the synchronization we have been studying between processes

Durability? How can we guarantee that committed changes are remembered even in the face of failures? Remembering = saving the data to some kind of storage device

Types of Storage Volatile Storage DRAM memory loses its contents when the power is removed Non-Volatile Storage Hard disks, floppy disks, CDs, tape drives are all examples of storage that does not lose its contents when power is removed Stable Storage Still non-volatile storage can lose its contents (magnets, microwave ovens, sledge hammers,..) “Stable storage” implies that the data has been backed up to multiple locations such that it is never lost