lec12

Course: CS 571, Spring 2008
School: George Mason
Rating:
 
 
 
 
 

Word Count: 1051

Document Preview

Systems Transactions 1 Transactions Transactions Operating Motivation Provide atomic operations at servers that maintain shared data for clients Provide recoverability from server crashes Properties Atomicity, Consistency, Isolation, Durability (ACID) Concepts: commit, abort Transactions 2 1 Operations of the Account interface deposit(amount) deposit amount in the account withdraw(amount) withdraw...

Register Now

Unformatted Document Excerpt

Coursehero >> Virginia >> George Mason >> CS 571

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Systems Transactions 1 Transactions Transactions Operating Motivation Provide atomic operations at servers that maintain shared data for clients Provide recoverability from server crashes Properties Atomicity, Consistency, Isolation, Durability (ACID) Concepts: commit, abort Transactions 2 1 Operations of the Account interface deposit(amount) deposit amount in the account withdraw(amount) withdraw amount from the account getBalance() -> amount return the balance of the account setBalance(amount) set the balance of the account to amount Operations of the Branch interface create(name) -> account create a new account with a given name lookUp(name) -> account return a reference to the account with the given name branchTotal() -> amount return the total of all the balances at the branch Transactions 3 A clients banking transaction Transaction T: a.withdraw(100); b.deposit(100); c.withdraw(200); b.deposit(200); Transactions 4 2 Operations in Coordinator interface openTransaction() -> trans; starts a new transaction and delivers a unique TID trans. This identifier will be used in the other operations in the transaction. closeTransaction(trans) -> (commit, abort); ends a transaction: a commit return value indicates that the transaction has committed; an abort return value indicates that it has aborted. abortTransaction(trans); aborts the transaction. Transactions 5 Transaction life histories Successful openTransaction operation operation Aborted by client openTransaction operation operation server aborts transaction Aborted by server openTransaction operation operation operation closeTransaction operation abortTransaction operation ERROR reported to client Transactions 6 3 Concurrency control Motivation: without concurrency control, we have lost updates, inconsistent retrievals, dirty reads, etc. (see following slides) Concurrency control schemes are designed to allow two or more transactions to be executed correctly while maintaining serial equivalence Serial Equivalence is correctness criterion Schedule produced by concurrency control scheme should be equivalent to a serial schedule in which transactions are executed one after the other Schemes: locking, optimistic concurrency control, time- stamp based concurrency control We will only study locking in this class Transactions 7 The lost update problem TransactionT : balance = b.getBalance(); b.setBalance(balance*1.1); a.withdraw(balance/10) balance = b.getBalance(); $200 TransactionU: balance = b.getBalance(); b.setBalance(balance*1.1); c.withdraw(balance/10) balance = b.getBalance(); $200 b.setBalance(balance*1.1); $220 b.setBalance(balance*1.1); $220 a.withdraw(balance/10) $80 c.withdraw(balance/10) $280 Transactions 8 4 The inconsistent retrievals problem Transaction V: a.withdraw(100) b.deposit(100) a.withdraw(100); $100 total = a.getBalance() total = total+b.getBalance() total = total+c.getBalance() b.deposit(100) $300 $100 $300 TransactionW: aBranch.branchTotal() Transactions 9 A serially equivalent interleaving of T and U TransactionT: balance = b.getBalance() b.setBalance(balance*1.1) a.withdraw(balance/10) balance = b.getBalance() $200 b.setBalance(balance*1.1) $220 balance = b.getBalance() $220 b.setBalance(balance*1.1) $242 a.withdraw(balance/10) $80 c.withdraw(balance/10) $278 TransactionU: balance = b.getBalance() b.setBalance(balance*1.1) c.withdraw(balance/10) Transactions 10 5 A serially equivalent interleaving of V and W TransactionV: a.withdraw(100); b.deposit(100) a.withdraw(100); b.deposit(100) $100 $300 total = a.getBalance() total = total+b.getBalance() total = total+c.getBalance() ... $100 $400 TransactionW: aBranch.branchTotal() Transactions 11 Read and write operation conflict rules Operations of different Conflict transactions read read No Reason Because the effect of a pair of readoperations does not depend on the order in which they are executed Because the effect of a read and a write operation depends on the order of their execution Because the effect of a pair of write operations depends on the order of their execution read write write write Yes Yes Transactions 12 6 A non-serially equivalent interleaving of operations of transactions T and U Transaction T: x = read(i) write(i, 10) Transaction U: y = read(j) write(j, 30) z = read (i) write(j, 20) Transactions 13 A dirty read when transaction T aborts TransactionT: a.getBalance() a.setBalance(balance + 10) balance = a.getBalance() $100 balance = a.getBalance() $110 TransactionU: a.getBalance() a.setBalance(balance + 20) a.setBalance(balance + 10) $110 a.setBalance(balance + 20) $130 commit transaction abort transaction Transactions 14 7 Transactions T and U with exclusive locks Transaction T : balance = b.getBalance() b.setBalance(bal*1.1) a.withdraw(bal/10) Operations Locks Transaction U : balance = b.getBalance() b.setBalance(bal*1.1) c.withdraw(bal/10) Operations Locks openTransaction bal = b.getBalance() lock B b.setBalance(bal*1.1) a.withdraw(bal/10) closeTransaction lock A unlockA, B lock B b.setBalance(bal*1.1) c.withdraw(bal/10) lock C closeTransaction unlockB, C Transactions 15 openTransaction bal = b.getBalance() waits forTs lock onB Lock compatibility For one object Lock already set none read write Lock requested read write OK OK wait OK wait wait Transactions 16 8 Use of locks in strict two-phase locking 1. When an operation accesses an object within a transaction: (a) If the object is not already locked, it is locked and the operation proceeds. (b) If the object has a conflicting lock set by another transaction, the transaction must wait until it is unlocked. (c) If the object has a non-conflicting lock set by another transaction, the lock is shared and the operation proceeds. (d) If the object has already been locked in the same transaction, the lock will be promoted if necessary and the operation proceeds. (Where promotion is prevented by a conflicting lock, rule (b) is used.) 2. When a transaction is committed or aborted, the server unlocks all objects it locked for the transaction. Transa...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

George Mason - CS - 365
Problem: ripple carry adder is slow Is a 32-bit ALU as fast as a 1-bit ALU? Is there more than one way to do addition? two extremes: ripple carry and sum-of-productsCan you see the ripple? How could you get rid of it? c1 c2 c3 c4 = = = = b0c0 b1
George Mason - CS - 4
CS 571 - Operating Systems Fall 2003 Project - A Distributed File System with Session Semantics Preliminary Design Document: Due Nov 17 Working System: Due Dec 8Your assignment is to implement a distributed le system and a simple interactive interfa
George Mason - CS - 571
CS 571 - Operating Systems Fall 2003 Project - A Distributed File System with Session Semantics Preliminary Design Document: Due Nov 17 Working System: Due Dec 8Your assignment is to implement a distributed le system and a simple interactive interfa
George Mason - CS - 571
Introduction to Distributed ComputingOperating Systems Prof. Sanjeev SetiaOperating Systems CS 5711Distributed systems Workgroups ATM (bank) machines WWW Multimedia conferencing Computing landscape will soon consist of ubiquitous network
George Mason - CS - 571
RMI: Design & ImplementationOperating SystemsRMI1Middleware layersApplications, services RMI and RPC request-reply protocol marshalling and external data representation UDP and TCP Middleware layersRMI21Request-reply communicationCli
George Mason - CS - 571
File SystemsOperating Systems1Long-term Information Storage1. 2. 3.Must store large amounts of data Information stored must survive the termination of the process using it Multiple processes must be able to access the information concurrently
George Mason - CS - 571
CPU SchedulingCS 5711CPU - I/O Burst Cycle Bursts of CPU usage alternate with periods of I/O wait a CPU-bound process an I/O bound process21Basic Concepts CPUI/O Burst Cycle Process execution consists of a cycle of CPU execution and I
George Mason - CS - 571
George Mason University CS 571 Operating Systems Section 2 Important Notes:Final Exam Dec 13, 19951. You have 150 minutes for answering the following questions. There are 8 questions in all. The pointsfor each question are indicated in bold at
George Mason - CS - 571
Computer Networks: OverviewOperating Systems CS 571Network typesRange LAN 1-2 kms WAN worldwide MAN 2-50 kms Wireless LAN 0.15-1.5 km Wireless WAN worldwide Internet worldwideBandwidth (Mbps) Latency (ms) 10-1000 0.010-600 1-150 2-11 0.010-2 0
George Mason - CS - 571
Communication in Distributed Systems: RPC/RMIMotivation Sockets API send & recv calls I/O Remote Procedure Calls (RPC) Goal: to provide a procedural interface for distributed (i.e., remote) services To make distributed nature of service trans
George Mason - CS - 571
Chapter 2 Processes and ThreadsToday 2.1 Processes 2.2 Threads Next week 2.3 Inter-process communication 2.4 Classical IPC problems Week 3 2.5 Scheduling1Process Concept An operating system executes a variety of programs: Batch system jobs Ti
George Mason - CS - 571
Memory Management1 Basic memory management 2 Swapping 3 Virtual memory 4 Page replacement algorithms 5 Design issues for paging systems 6 Implementation issues 7 Segmentation1Memory Management Ideally programmers want memory that is large fas
George Mason - CS - 571
GEORGE MASON UNIVERSITY Computer Science Department CS 571 Operating Systems Fall 1995 Mid-term Exam DUE DATE Nov 151. (a) Write pseudo-code for implementing Solaris mutexes and condition variables using semaphores. Specically, you have to describ
George Mason - CS - 4
CS 571 - Operating Systems Fall 2002 Project - A Distributed File System with Session Semantics Preliminary Design Document: Due Nov 19 Working System: Due Dec 6Your assignment is to implement a distributed le system and a simple interactive interfa
George Mason - CS - 571
CS 571 - Operating Systems Fall 2002 Project - A Distributed File System with Session Semantics Preliminary Design Document: Due Nov 19 Working System: Due Dec 6Your assignment is to implement a distributed le system and a simple interactive interfa
George Mason - CS - 571
GEORGE MASON UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE CS 571 OPERATING SYSTEMS Fall 2002 Assignment 1: DUE Sept 10Experiment 1. Thread and Process Creation Study the programs thr_create.c and fork.c. Compile and execute the programs. These progra
George Mason - CS - 571
Operating Systems CS 571Prof. Sanjeev Setia Fall 20021Overview Prerequisites Computer Architecture (CS 365) Data structures and programming (CS 310) (C+/C/Java progamming) Textbooks Modern Operating Systems (Tannenbaum) Distributed System
George Mason - CS - 2
GEORGE MASON UNIVERSITY Computer Science Department CS 571 Operating Systems Fall 2002 Assignment 2 Multithreaded Programming DUE DATE Oct 1Process Synchronization The goal of this exercise to give you some experience writing concurrent programs.
George Mason - CS - 571
GEORGE MASON UNIVERSITY Computer Science Department CS 571 Operating Systems Fall 2002 Assignment 2 Multithreaded Programming DUE DATE Oct 1Process Synchronization The goal of this exercise to give you some experience writing concurrent programs.
George Mason - CS - 571
Time and Coordination in Distributed SystemsOperating Systems1Clock SynchronizationPhysical clocks drift, therefore need for clock synchronization algorithmsMany algorithms depend upon clock synchronization Often we need to know the order in
George Mason - CS - 571
BackgroundConcurrent access to shared data may result in data inconsistency. Maintaining data consistency requires mechanisms to ensure the orderly execution of cooperating processes. Bounded Buffer problem (also called producer consumer problem)1
George Mason - CS - 571
Distributed File SystemsOperating Systems1Distributed-File Systems Background Naming and Transparency Remote File Access Stateful versus Stateless Service File Replication Example Systems NFS AFS DFS project21Background Distribu
George Mason - CS - 571
Communication in distributed systems: network programming using sockets Operating SystemsTCP/IP layersLayers ApplicationMessageMessages (UDP) or Streams (TCP) Transport UDP or TCP packets Internet IP datagrams Network interface Network-specif
George Mason - CS - 571
Figure 5.5C program for client in Sun RPC./* File : C.c - Simple client of the FileReadWrite service. */ #include <stdio.h> #include <rpc/rpc.h> #include "FileReadWrite .h" main(int argc, char * argv) { CLIENT *clientHandle; char *serverName = "co
George Mason - CS - 3
GEORGE MASON UNIVERSITY Computer Science Department CS 571 Operating Systems Fall 2002 Assignment 3 Client-Server Programming using Sockets and RPC/RMI DUE DATE Oct 221. Implementing an arithmetic server using sockets Write a program with two par
George Mason - CS - 571
GEORGE MASON UNIVERSITY Computer Science Department CS 571 Operating Systems Fall 2002 Assignment 3 Client-Server Programming using Sockets and RPC/RMI DUE DATE Oct 221. Implementing an arithmetic server using sockets Write a program with two par
George Mason - CS - 3
GEORGE MASON UNIVERSITY Computer Science Department CS 571 Operating Systems Assignment 3 Client-Server Programming using Sockets and RPC/RMI1. Implementing an arithmetic server using sockets Write a program with two parts: 1) a client, and 2) an
George Mason - CS - 571
GEORGE MASON UNIVERSITY Computer Science Department CS 571 Operating Systems Assignment 3 Client-Server Programming using Sockets and RPC/RMI1. Implementing an arithmetic server using sockets Write a program with two parts: 1) a client, and 2) an
George Mason - CS - 2
GEORGE MASON UNIVERSITY Computer Science Department CS 571 Operating Systems Fall 2003 Assignment 2 Multithreaded Programming DUE DATE Oct 6Process Synchronization The goal of this exercise to give you some experience writing concurrent programs.
George Mason - CS - 571
GEORGE MASON UNIVERSITY Computer Science Department CS 571 Operating Systems Fall 2003 Assignment 2 Multithreaded Programming DUE DATE Oct 6Process Synchronization The goal of this exercise to give you some experience writing concurrent programs.
George Mason - CS - 367
Chapter 4 The Von Neumann ModelACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University4-21The Stored Program Computer1943: ENIAC Presper Eckert and John Mauchly - first general electronic compu
George Mason - CS - 367
Bitwise OperatorsSymbol ~ < > & ^ | Operation bitwise NOT left shift right shift bitwise AND bitwise XOR bitwise OR Usage ~x x < y x > y x & y x ^ y x | yPrecedence 4 8 8 11 12 13 Assoc r-to-l l-to-r l-to-r l-to-r l-to-r l-to-rOperate on variable
George Mason - CS - 365
Ch 5: Designing a Single Cycle DatapathComputer Systems Architecture CS 365The Big Picture: Where are We Now? The Five Classic Components of a ComputerProcessor Input Control Memory Datapath Output Today Topic: Design a Single Cycle Processo
George Mason - CS - 818
Privacy and Security in library RFID Issues, Practices and ArchitectureDavid Molnar and David Wagner University of California, BerkeleyCCS '04 October 2004OverviewMotivation RFID Background Library RFID IssuesCurrent Architectures, Atta
George Mason - CS - 580
T R E N D S&C O N T R O V E R S I E SPlaying with AIThe use of puzzles and games in AI research dates to its earliest days. In the early 1950s, Claude Shannon and Alan Turing wrote papers proposing the creation of computer programs that could
George Mason - CS - 803
Data-Hiding CodesPIERRE MOULIN, FELLOW, IEEE, AND RALF KOETTER, MEMBER, IEEE Invited PaperThis tutorial paper reviews the theory and design of codes for hiding or embedding information in signals such as images, video, audio, graphics, and text. S
George Mason - CS - 682
CS 682: Computer VisionDr. Zoran DuricCS Dept. GMUJanuary 27, 2009Oce: S&T II, Rm. 427 email: zduric@cs.gmu.edu Oce Hours: Tue. 2:00-4:00pm, Thu 1:30-2:30pm or by app. URL: http:/www.cs.gmu.edu/zduric/ Course: http:/www.cs.gmu.edu/zduric/cs682.
George Mason - CS - 580
CS 580'$1Introduction to Articial Intelligence: cs580Dr. Zoran Duric Oce: S&T II, Rm. 427 email: zduric@cs.gmu.edu Oce Hours: Tue. 2:00-4:00pm or by app. URL: http:/www.cs.gmu.edu/zduric/ Course: http:/www.cs.gmu.edu/zduric/cs580.html&%
George Mason - CS - 580
LispLisp: Question 1Write a recursive lisp function that takes a list as an argument and returns the number of atoms on any level of the list. For instance, list (A B (C D E ) () contains six atoms (A, B, C , D, E , and NIL). (defun count-atoms (
George Mason - CS - 580
'$Intelligent AgentsChapter 2&1%'$Outline Agents and environments Rationality PEAS (Performance measure, Environment, Actuators, Sensors) Environment types Agent types&2%'$Agents and environmentssensors percepts envi
George Mason - CS - 580
X X X X X1/ 10 Dr. Zoran Duric (CS Dept., GMU)MAX nodes MIN nodesXStart nodeAlpha-Beta Pruning ExampleAlpha-Beta Pruning(Backed-up value = +1)XX X X 1998 Morgan Kaufman PublishersMidterm Review 3XX X2 +2 3 +3 1 1 +1 +5 +4 +1
George Mason - CS - 682
Projectss s sSummarizing videossSummarizing videos Find image copies Detecting motion patterns in surveillance videoss sUse edge and flow histograms as image descriptors to summarize videos Use k-means to find sub-sequence center frames Tes
George Mason - CS - 112
Pickling and ShelvesDan FleckComing up: What is pickling?What is pickling?Pickling - is the process of preserving food by anaerobic fermentation in brine (a solution of salt in water), to produce lactic acid, or marinating and storing it in an
George Mason - CS - 112
CS 112 Lab AssignmentInstructor: Dan Fleck Lab: 401K MathOverviewThis lab will help you understand the mathematical operators in Python and how to get user input. Additionally, it will show you the financial benefits of a 401(k) program, and why
George Mason - CS - 112
CS 112 Lab AssignmentInstructor: Dan Fleck Lab: Web Favorites (to learn how to create and use Classes) Due Date: As with all labs, this lab is due one week from your lab section!OverviewThis lab will familiarize you with creating and using Classe
George Mason - CS - 112
Python Programming: An Introduction To Computer ScienceChapter 8 BooleansComing up: Computing with Booleans1Computing with Booleans!if and while both use Boolean expressions. ! Boolean expressions evaluate to True or False. ! So far weve used
George Mason - CS - 112
Python Programming: An Introduction to Computer ScienceChapter 4 (End of Chapter) File IOComing up: File Processing1File Processing! The process of opening a file involves associating a file on disk with a variable. ! We can manipulate the fi
George Mason - CS - 112
Creating a large GUI ProgramDan Fleck Spring 2007Coming up: Hangman yes again!Hangman yes again!! Lets say we want to create a more fun, graphical version of our Hangman game. This is alarger program and we will follow the Software Developmen
George Mason - CS - 112
The Software Development Process Python Programming: An Introduction to Computer Science Chapter 2 Dan Fleck The process of creating a program is often broken down into stages according to the information that is produced in each phase.Coming up:
George Mason - CS - 112
Passing a function as a parameter and How NOT to do menusDan FleckComing up: Passing Functions as ParametersPassing Functions as Parameters You have seen in GUI programming that Buttons (for example) allow you to pass a function to the button t
George Mason - CS - 112
Objectives Python Programming: An Introduction to Computer ScienceChapter 3 Computing with Numbers Updated by Dan FleckComing up: Objectives 1 Coming up: Numeric Data Types 2 To understand the concept of data types. To be familiar with the basic
George Mason - CS - 112
The Function of Functions Python Programming: An Introduction to Computer ScienceChapter 6 Functions,Variables,Modules Why use functions at all? Reduces duplicate code (Less maintenance, debugging, etc) Makes programs easier to read Makes progra
George Mason - CS - 112
The String Data Type Python Programming: An Introduction to Computer ScienceChapter 4 Computing with Strings The most common use of personal computers is word processing. Text is represented in programs by the string data type. A string is a sequ
George Mason - CS - 112
Debugging & Errors Why you were up till 2AMDan Fleck Fall 2008Coming up: Running programs from the command lineRunning programs from the command lineIn windows just double-click on the sliders.py le In Unix/Mac (or Windows also) run the command
George Mason - CS - 112
Sorting and ComparatorsDan FleckComing up: Sorting a listSorting a list! Sorting a list seems simple: myList = [1, 4, 3, 5] myList.sort() print myList > [1, 3, 4, 5] Backwards? Not so hard reallyOkay, how about backwards then!! A little hard
George Mason - CS - 112
Exception HandlingDan FleckComing up: Long ago we wrote thisLong ago we wrote thisdef addGraphicalButton(parent): # Create the PhotoImage widget im = PhotoImage(file='cake.gif') button2 = Button(root, text="Potato", image=im) button2.image = im
George Mason - CS - 112
Python Programming: An Introduction To Computer ScienceChapter 10 Defining Classes (These slides were heavily editted/ rewritten by Dan Fleck)Coming up: Objectives 1Objectives! To appreciate how defining new classes can provide structure for a c
George Mason - CS - 112
Python Programming: An Introduction to Computer ScienceChapter 1 Computers and Programs Modified by Dan FleckObjectives Introduction to the class Why we program and what that means Introduction to the Python programming languageComing up: Wha
George Mason - CS - 112
Tkinter GUIs in PythonDan Fleck CS112 George Mason UniversityNOTE: This information is not in your textbook! See references for more information!Coming up: What is it?What is it?! Tkinter is a Python interface to the Tk graphics library.!Tk i
George Mason - CS - 112
New Datatypes:Tuples and SetsDan FleckComing up: Passing a list as a parameterPassing a list as a parameterdef class FamilyTree:# This class holds a list of family members in the variable tree lots of code not shown def getTree(self): retur
George Mason - CS - 112
CS 112 Lab AssignmentInstructor: Dan Fleck Lab: Pig Latin TranslatorOverviewThis lab will familiarize you with the String class and String functions available in Python. You will be ask the user for a word and convert it into PigLatin. Pig Latin