1 / 11

CS444/CS544 Operating Systems

CS444/CS544 Operating Systems. Atomic Transactions 3/26/2007 Prof. Searleman jets@clarkson.edu. Outline. Return & discuss Exam#2 Deadlock Atomic Transactions NOTE: Read: Chapter 8 HW#9 posted, Friday, 3/30. Recap: Banker’s Algorithm. If a process requests some resources, determine

sebastien
Download Presentation

CS444/CS544 Operating Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS444/CS544Operating Systems Atomic Transactions 3/26/2007 Prof. Searleman jets@clarkson.edu

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

  3. Recap:Banker’s Algorithm • If a process requests some resources, determine • are there enough resources currently available? • if so, does it leave the system in a “safe state”?

  4. P1 requests (1, 0, 2). Available (3, 3, 2)

  5. 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

  6. 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

  7. 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?

  8. 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

  9. 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

  10. 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

  11. 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

More Related