1 The comparison of QC, SC and LIN

Size: px
Start display at page:

Download "1 The comparison of QC, SC and LIN"

Transcription

1 Com S 611 Spring Semester 2009 Algorithms for Multiprocessor Synchronization Lecture 5: Tuesday, 3rd February 2009 Instructor: Soma Chaudhuri Scribe: Jianrong Dong 1 The comparison of QC, SC and LIN Pi Wi Ri [ read(x,0) ] Pj [ write(x,0) ] Wj Rj Figure 1: Execution 1. QC but not SC Execution 1: QC satisfied but SC unsatisfied QC is satisfied. There are two legal sequences W i R j W j R i or W j R i W i R j. Since there are no operations after the quiescent state, and QC requires precedence between those operations before and after the quiescent state. SC is unsatisfied. There are only two possible sequences W i R j W j R i or W j R i W i R j that are legal since reads get values of the most recent preceding writes. However, neither of the two sequences preserve the program order of P j or P i, respectively. Execution 2: SC is satisfied but QC is unsatisfied SC is satisfied. There is a sequence W i1 R j W i2 that satisfies the legal requirement since R j gets 1 from the most recent preceding write W i1, and it also preserves the program order for P i. Therefore it satisfies SC. QC is unsatisfied. Since there are two quiescent states, one between the WRITE s, one between the second WRITE and READ, there is only one sequence W i1 W i2 R j that satisfies the second property of QC, but it is illegal and thus does not satisfy the first property of QC. Refer to the notes from last class for definition of QC. 1

2 Wi1 Wi2 Pi [ write(x,0) ] Pj Rj Figure 2: Execution 2. SC but not QC W0 R0 x=0 [ read(y,1) ] y=0 [ write(y,1) ] W1 R1 Figure 3: Execution 3. LIN and SC are satisfied Execution 3: LIN satisfied and SC satisfied. LIN is satisfied. There is a sequence W 0 W 1 R 0 R 1 that satisfies the legal requirement for registers x and y. Also the response of writes are ahead of the invocations of reads in this sequence as well as in real time. SC is satisfied. The above sequence satisfies the legal requirement for registers x and y. Also it preserves the program order for P 0 and P 1. Execution 3 variation 1. LIN is unsatisfied and SC is satisfied. LIN is unsatisfied. If we preserve the real time order, R 0 cannot return 0 since W 1 has finished writing 1 into y. That is, the operation of register y is not legal. Therefore, LIN is not satisfied. 2

3 W0 R0 x=0 [ read(y,0) ] y=0 [ write(y,1) ] W1 R1 Figure 4: Execution 3 variation 1. LIN is unsatisfied and SC is satisfied SC is satisfied. The sequence W 0 R 0 W 1 R 1 is SC. It preserves the program order. Also since R 0 = [READ(y, 0)] reads the initial value of y(= 0), and R 1 = [READ(x, 1)] reads the value that W 0 writes, the operations of the registers are legal. W0 R0 x=0 [ read(y,0) ] y=0 [ write(y,1) ] [ read(x,0) ] W1 R1 Figure 5: Execution 3 variation 2. Neither LIN nor SC is satisfied Execution 3 variation 2. Neither LIN nor SC is satisfied. LIN is unsatisfied. If we preserve the real time order, R 0 cannot return 0 since W 1 has finished writing 1 into y. That is, the operation of register y is not legal. Similarly the operation of register x is not legal either. Therefore, LIN is not satisfied. SC is unsatisfied. Due to program order W 0 < R 0, W 1 < R 1. Due to register operation legality requirement, R 0 < W 1, R 1 < W 0. Therefore, we have W 0 < R 0 < W 1 < R 1 < W 0. Contradiction. 3

4 2 More on linearizability 2.1 Linearization points The usual way to show that a concurrent object implementation is linearizable is to identify for each method a linearization point where the method takes effect. For lock-based implementations, each method s critical section can serve as its linearization point. For implementations that do not use locking, the linearization point is typically a single step where the effects of the method call become visible to other method calls. 2.2 The nonblocking property Linearizability is a nonblocking property: a pending invocation of a total method is never required to wait for another pending invocation to complete. By definition, linearizability by itself never forces a thread with a pending invocation of a total method to block. Linearizability is an appropriate correctness condition for systems where concurrency and real-time response are important. 3 Progress conditions Definition 1 (blocking) An unexpected delay by one thread can prevent others from making progress. Definition 2 (wait-free operation) Every invocation of a wait-free operation finishes its execution in a finite number of steps. Definition 3 (wait-free object) An object is a wait-free object if all operations on that object are wait-free. Definition 4 (bounded wait-free) Every invocation of a bounded wait-free operation completes in a bounded number of steps. Note wait-free can still be unbounded. Definition 5 (nonblocking progress condition) The nonblocking progress condition means that an arbitrary and unexpected delay by one thread does not necessarily prevent the others from making progress. Wait-free is a nonblocking progress condition. However, wait-free algorithms can be inefficient and sometimes we are willing to settle for a weaker nonblocking property. Definition 6 (lock-free) A method is lock-free if it guarantees that infinitely often some invocation to this object finishes in finite number of steps. Note wait-free lock-free, but not vice versa. 4

5 3.1 Dependent progress conditions The wait-free and lock-free nonblocking progress conditions guarantee that the computation as a whole makes progress, independently of how the system schedules threads. However deadlockfree and starvation free are dependent progress conditions. deadlock-free and starvation free Definition 7 (Dependent progress conditions) Progress occurs only if the underlying platform (i.e. the operating system) provides certain guarantees. Operations rely on lock-based synchronization can guarantee, at best, dependent progress properties. There is another dependent nonblocking progress condition; the obstruction-free property. Definition 8 (Obstruction-free) dependent nonblocking progress condition. An operation is obstruction-free if, from any point after which it executes in isolation, it finishes in a finite number of steps. Obstruction-free is weaker than wait-free. Lock-free obstruction free, but not vice versa. 4 Additional Architecture prefers as weak memory consistency as possible. Programmer prefers as strong as possible. Relaxed memory consistency condition + program rules sequential consistency. It is desirable but not always achievable. We will look at results of that kind later, with different definitions for relaxed MC and program rules. 5 Read/write registers We require that our register implementations to be wait-free. We address the following fundamental question: Can any data structure implemented from the most powerful registers we define also be implemented from the weakest? Three properties are discussed as follows: safe, regular and atomic. Definition 9 (safe) A single-writer, multiple-reader register implementation is safe if A READ that does not overlap a WRITE call returns the value written by the most recent WRITE. 5

6 If a READ overlaps a WRITE, then given the possible values of register {0,..., m 1}, READ returns v {0,..., m 1} regardless what is being written. Definition 10 (regular) A regular register is a multi-reader, single-writer register when writes do not happen atomically. A regular register is safe, so any READ that does not overlap a WRITE call returns the most recently written value. If a READ overlaps one or more WRITE. READ returns value of last preceding WRITE or any overlapping WRITE. 0 [ WRITE 1 ] [ WRITE 2 ] [ READ v1 ] [ READ v2 ] Figure 6: Regular register Note for a regular register v 1 {0, 1, 2} corresponding to one most recent preceding WRITE and two overlapping WRITE. v 2 {1, 2} corresponding to one most recent preceding WRITE and one overlapping WRITE. Definition 11 (atomic) An single-reader single-writer atomic register is a linearizable implementation of the sequential register class. Any concurrent operations can be linearized, taking one spot of time of its READ or WRITE operation. Informally an atomic register behaves exactly as we would expect: each read returns the last value written. In the above example. For an atomic register, if v 1 = 0, v 2 = {1, 2}; if v 1 = 1, v 2 = {1, 2}; if v 1 = 2, v 2 = Construct a multi-reader register Registers can be safe, regular, or atomic, or they can be binary or k-ary. They can have single or multiple reader, and single or multiple writer. We try to construct a multi-reader single-writer register (MRSW) with single-reader single-writer binary safe registers (SRSW). Note the big rectangle is for the MRSW while the small one is for the SRSW s. The MRSW register has the following properties. If SRSW is safe, MRSW is safe. 6

7 R1 V R2 V W Rn V Figure 7: Construct MRSW register with SRSW registers If SRSW is regular, MRSW is regular. For proof, please refer to the notes for the next class. Atomic is a problem. Since the single writer needs to write into different SRSW s, although each write individually is atomic, the whole writing process is not atomic. During the writing process, some READ gets old value because WRITE has not updated its corresponding SRSW yet, while some gets new value as WRITE has updated its corresponding register. 7

Shared memory model" Shared memory guarantees" Read-write register" Wait-freedom: unconditional progress " Liveness" Shared memory basics"

Shared memory model Shared memory guarantees Read-write register Wait-freedom: unconditional progress  Liveness Shared memory basics Shared memory basics INF346, 2014 Shared memory model Processes communicate by applying operations on and receiving responses from shared objects! A shared object is a state machine ü States ü Operations/Responses

More information

Overview of Lecture 4. Memory Models, Atomicity & Performance. Ben-Ari Concurrency Model. Dekker s Algorithm 4

Overview of Lecture 4. Memory Models, Atomicity & Performance. Ben-Ari Concurrency Model. Dekker s Algorithm 4 Concurrent and Distributed Programming http://fmt.cs.utwente.nl/courses/cdp/ Overview of Lecture 4 2 Memory Models, tomicity & Performance HC 4 - Tuesday, 6 December 2011 http://fmt.cs.utwente.nl/~marieke/

More information

Wait-Free Regular Storage from Byzantine Components

Wait-Free Regular Storage from Byzantine Components Wait-Free Regular Storage from Byzantine Components Ittai Abraham Gregory Chockler Idit Keidar Dahlia Malkhi July 26, 2006 Abstract We consider the problem of implementing a wait-free regular register

More information

Mutual Exclusion. 1 Formal problem definitions. Time notion CSE /17/2015. Outline of this lecture:

Mutual Exclusion. 1 Formal problem definitions. Time notion CSE /17/2015. Outline of this lecture: CSE 539 03/17/2015 Mutual Exclusion Lecture 15 Scribe: Son Dinh Outline of this lecture: 1. Formal problem definitions 2. Solution for 2 threads 3. Solution for n threads 4. Inherent costs of mutual exclusion

More information

Shared Memory Seif Haridi

Shared Memory Seif Haridi Shared Memory Seif Haridi haridi@kth.se Real Shared Memory Formal model of shared memory No message passing (No channels, no sends, no delivers of messages) Instead processes access a shared memory Models

More information

Important Lessons. A Distributed Algorithm (2) Today's Lecture - Replication

Important Lessons. A Distributed Algorithm (2) Today's Lecture - Replication Important Lessons Lamport & vector clocks both give a logical timestamps Total ordering vs. causal ordering Other issues in coordinating node activities Exclusive access to resources/data Choosing a single

More information

Overview: Memory Consistency

Overview: Memory Consistency Overview: Memory Consistency the ordering of memory operations basic definitions; sequential consistency comparison with cache coherency relaxing memory consistency write buffers the total store ordering

More information

R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch

R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch - Shared Memory - R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch R. Guerraoui 1 The application model P2 P1 Registers P3 2 Register (assumptions) For presentation simplicity, we assume

More information

Concurrent Objects and Linearizability

Concurrent Objects and Linearizability Chapter 3 Concurrent Objects and Linearizability 3.1 Specifying Objects An object in languages such as Java and C++ is a container for data. Each object provides a set of methods that are the only way

More information

Chapter 5 Concurrency: Mutual Exclusion and Synchronization

Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles Chapter 5 Concurrency: Mutual Exclusion and Synchronization Seventh Edition By William Stallings Designing correct routines for controlling concurrent

More information

Self Stabilization. CS553 Distributed Algorithms Prof. Ajay Kshemkalyani. by Islam Ismailov & Mohamed M. Ali

Self Stabilization. CS553 Distributed Algorithms Prof. Ajay Kshemkalyani. by Islam Ismailov & Mohamed M. Ali Self Stabilization CS553 Distributed Algorithms Prof. Ajay Kshemkalyani by Islam Ismailov & Mohamed M. Ali Introduction There is a possibility for a distributed system to go into an illegitimate state,

More information

Shared Objects. Shared Objects

Shared Objects. Shared Objects Shared Objects Shared Objects Invoked operations have a non-zero duration Invocations can overlap Useful for: modeling distributed shared memory Objects can be combined together to implement higher level

More information

arxiv: v8 [cs.dc] 29 Jul 2011

arxiv: v8 [cs.dc] 29 Jul 2011 On the Cost of Concurrency in Transactional Memory Petr Kuznetsov TU Berlin/Deutsche Telekom Laboratories Srivatsan Ravi TU Berlin/Deutsche Telekom Laboratories arxiv:1103.1302v8 [cs.dc] 29 Jul 2011 Abstract

More information

The Relative Power of Synchronization Methods

The Relative Power of Synchronization Methods Chapter 5 The Relative Power of Synchronization Methods So far, we have been addressing questions of the form: Given objects X and Y, is there a wait-free implementation of X from one or more instances

More information

Review. Review. Review. Constructing Reliable Registers From Unreliable Byzantine Components 12/15/08. Space of registers: Transformations:

Review. Review. Review. Constructing Reliable Registers From Unreliable Byzantine Components 12/15/08. Space of registers: Transformations: Review Constructing Reliable Registers From Unreliable Byzantine Components Space of registers: Dimension 1: binary vs. multivalued Dimension 2: safe vs. regular vs. atomic Seth Gilbert Dimension 3: SRSW

More information

Process Synchronization. Mehdi Kargahi School of ECE University of Tehran Spring 2008

Process Synchronization. Mehdi Kargahi School of ECE University of Tehran Spring 2008 Process Synchronization Mehdi Kargahi School of ECE University of Tehran Spring 2008 Producer-Consumer (Bounded Buffer) Producer Consumer Race Condition Producer Consumer Critical Sections Structure of

More information

The Wait-Free Hierarchy

The Wait-Free Hierarchy Jennifer L. Welch References 1 M. Herlihy, Wait-Free Synchronization, ACM TOPLAS, 13(1):124-149 (1991) M. Fischer, N. Lynch, and M. Paterson, Impossibility of Distributed Consensus with One Faulty Process,

More information

Lecture 7: Mutual Exclusion 2/16/12. slides adapted from The Art of Multiprocessor Programming, Herlihy and Shavit

Lecture 7: Mutual Exclusion 2/16/12. slides adapted from The Art of Multiprocessor Programming, Herlihy and Shavit Principles of Concurrency and Parallelism Lecture 7: Mutual Exclusion 2/16/12 slides adapted from The Art of Multiprocessor Programming, Herlihy and Shavit Time Absolute, true and mathematical time, of

More information

IT 540 Operating Systems ECE519 Advanced Operating Systems

IT 540 Operating Systems ECE519 Advanced Operating Systems IT 540 Operating Systems ECE519 Advanced Operating Systems Prof. Dr. Hasan Hüseyin BALIK (5 th Week) (Advanced) Operating Systems 5. Concurrency: Mutual Exclusion and Synchronization 5. Outline Principles

More information

Lecture 21 Concurrency Control Part 1

Lecture 21 Concurrency Control Part 1 CMSC 461, Database Management Systems Spring 2018 Lecture 21 Concurrency Control Part 1 These slides are based on Database System Concepts 6 th edition book (whereas some quotes and figures are used from

More information

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University CS 571 Operating Systems Midterm Review Angelos Stavrou, George Mason University Class Midterm: Grading 2 Grading Midterm: 25% Theory Part 60% (1h 30m) Programming Part 40% (1h) Theory Part (Closed Books):

More information

ACONCURRENT system may be viewed as a collection of

ACONCURRENT system may be viewed as a collection of 252 IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 10, NO. 3, MARCH 1999 Constructing a Reliable Test&Set Bit Frank Stomp and Gadi Taubenfeld AbstractÐThe problem of computing with faulty

More information

Peterson s Algorithm

Peterson s Algorithm Peterson s Algorithm public void lock() { flag[i] = true; victim = i; while (flag[j] && victim == i) {}; } public void unlock() { flag[i] = false; } 24/03/10 Art of Multiprocessor Programming 1 Mutual

More information

Concurrent Objects. Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit

Concurrent Objects. Companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Concurrent Objects Companion slides for The by Maurice Herlihy & Nir Shavit Concurrent Computation memory object object 2 Objectivism What is a concurrent object? How do we describe one? How do we implement

More information

Threads and Locks. Chapter Introduction Locks

Threads and Locks. Chapter Introduction Locks Chapter 1 Threads and Locks 1.1 Introduction Java virtual machines support multiple threads of execution. Threads are represented in Java by the Thread class. The only way for a user to create a thread

More information

Lock-free Serializable Transactions

Lock-free Serializable Transactions Lock-free Serializable Transactions Jeff Napper jmn@cs.utexas.edu Lorenzo Alvisi lorenzo@cs.utexas.edu Laboratory for Advanced Systems Research Department of Computer Science The University of Texas at

More information

Lecture: Consistency Models, TM. Topics: consistency models, TM intro (Section 5.6)

Lecture: Consistency Models, TM. Topics: consistency models, TM intro (Section 5.6) Lecture: Consistency Models, TM Topics: consistency models, TM intro (Section 5.6) 1 Coherence Vs. Consistency Recall that coherence guarantees (i) that a write will eventually be seen by other processors,

More information

6.033: Fault Tolerance: Isolation Lecture 17 Katrina LaCurts,

6.033: Fault Tolerance: Isolation Lecture 17 Katrina LaCurts, 6.033: Fault Tolerance: Isolation Lecture 17 Katrina LaCurts, lacurts@mit.edu 0. Introduction - Last time: Atomicity via logging. We're good with atomicity now. - Today: Isolation - The problem: We have

More information

[module 2.2] MODELING CONCURRENT PROGRAM EXECUTION

[module 2.2] MODELING CONCURRENT PROGRAM EXECUTION v1.0 20130407 Programmazione Avanzata e Paradigmi Ingegneria e Scienze Informatiche - UNIBO a.a 2013/2014 Lecturer: Alessandro Ricci [module 2.2] MODELING CONCURRENT PROGRAM EXECUTION 1 SUMMARY Making

More information

k-abortable Objects: Progress under High Contention

k-abortable Objects: Progress under High Contention k-abortable Objects: Progress under High Contention Naama Ben-David 1, David Yu Cheng Chan 2, Vassos Hadzilacos 2, and Sam Toueg 2 Carnegie Mellon University 1 University of Toronto 2 Outline Background

More information

Chapter 12: Distributed Shared Memory

Chapter 12: Distributed Shared Memory Chapter 12: Distributed Shared Memory Ajay Kshemkalyani and Mukesh Singhal Distributed Computing: Principles, Algorithms, and Systems Cambridge University Press A. Kshemkalyani and M. Singhal (Distributed

More information

Chapter 5 Concurrency: Mutual Exclusion. and. Synchronization. Operating Systems: Internals. and. Design Principles

Chapter 5 Concurrency: Mutual Exclusion. and. Synchronization. Operating Systems: Internals. and. Design Principles Operating Systems: Internals and Design Principles Chapter 5 Concurrency: Mutual Exclusion and Synchronization Seventh Edition By William Stallings Designing correct routines for controlling concurrent

More information

Relaxed Memory-Consistency Models

Relaxed Memory-Consistency Models Relaxed Memory-Consistency Models Review. Why are relaxed memory-consistency models needed? How do relaxed MC models require programs to be changed? The safety net between operations whose order needs

More information

Concurrent Programming: Algorithms, Principles, and Foundations

Concurrent Programming: Algorithms, Principles, and Foundations Concurrent Programming: Algorithms, Principles, and Foundations Algorithms, Principles, and Foundations Bearbeitet von Michel Raynal 1. Auflage 2012. Buch. xxxii, 516 S. Hardcover ISBN 978 3 642 32026

More information

Lecture 27: Safety and Liveness Properties, Java Synchronizers, Dining Philosophers Problem

Lecture 27: Safety and Liveness Properties, Java Synchronizers, Dining Philosophers Problem COMP 322: Fundamentals of Parallel Programming Lecture 27: Safety and Liveness Properties, Java Synchronizers, Dining Philosophers Problem Mack Joyner and Zoran Budimlić {mjoyner, zoran}@rice.edu http://comp322.rice.edu

More information

DD2451 Parallel and Distributed Computing --- FDD3008 Distributed Algorithms

DD2451 Parallel and Distributed Computing --- FDD3008 Distributed Algorithms DD2451 Parallel and Distributed Computing --- FDD3008 Distributed Algorithms Lecture 3 Atomic Registers Mads Dam Autumn/Winter 2011 This Lecture Registers: Shared memory loca6ons that can be read and wri'en

More information

CS510 Advanced Topics in Concurrency. Jonathan Walpole

CS510 Advanced Topics in Concurrency. Jonathan Walpole CS510 Advanced Topics in Concurrency Jonathan Walpole Threads Cannot Be Implemented as a Library Reasoning About Programs What are the valid outcomes for this program? Is it valid for both r1 and r2 to

More information

Relaxed Memory-Consistency Models

Relaxed Memory-Consistency Models Relaxed Memory-Consistency Models [ 9.1] In small multiprocessors, sequential consistency can be implemented relatively easily. However, this is not true for large multiprocessors. Why? This is not the

More information

Consistency and Replication. Why replicate?

Consistency and Replication. Why replicate? Consistency and Replication Today: Consistency models Data-centric consistency models Client-centric consistency models Lecture 15, page 1 Why replicate? Data replication versus compute replication Data

More information

Time and Space Lower Bounds for Implementations Using k-cas

Time and Space Lower Bounds for Implementations Using k-cas Time and Space Lower Bounds for Implementations Using k-cas Hagit Attiya Danny Hendler September 12, 2006 Abstract This paper presents lower bounds on the time- and space-complexity of implementations

More information

Lecture: Consistency Models, TM

Lecture: Consistency Models, TM Lecture: Consistency Models, TM Topics: consistency models, TM intro (Section 5.6) No class on Monday (please watch TM videos) Wednesday: TM wrap-up, interconnection networks 1 Coherence Vs. Consistency

More information

Concurrency. Chapter 5

Concurrency. Chapter 5 Concurrency 1 Chapter 5 2 Concurrency Is a fundamental concept in operating system design Processes execute interleaved in time on a single processor Creates the illusion of simultaneous execution Benefits

More information

Unit 6: Indeterminate Computation

Unit 6: Indeterminate Computation Unit 6: Indeterminate Computation Martha A. Kim October 6, 2013 Introduction Until now, we have considered parallelizations of sequential programs. The parallelizations were deemed safe if the parallel

More information

Database System Concepts

Database System Concepts Chapter 15+16+17: Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2010/2011 Slides (fortemente) baseados nos slides oficiais do livro c Silberschatz, Korth and Sudarshan.

More information

On the Correctness of Transactional Memory

On the Correctness of Transactional Memory On the Correctness of Transactional Memory Rachid Guerraoui Michał Kapałka School of Computer and Communication Sciences, EPFL {rachid.guerraoui, michal.kapalka}@epfl.ch Abstract Transactional memory (TM)

More information

Building Efficient Concurrent Graph Object through Composition of List-based Set

Building Efficient Concurrent Graph Object through Composition of List-based Set Building Efficient Concurrent Graph Object through Composition of List-based Set Sathya Peri Muktikanta Sa Nandini Singhal Department of Computer Science & Engineering Indian Institute of Technology Hyderabad

More information

Concurrency Control Algorithms

Concurrency Control Algorithms Concurrency Control Algorithms Given a number of conflicting transactions, the serializability theory provides criteria to study the correctness of a possible schedule of execution it does not provide

More information

Programming Paradigms for Concurrency Lecture 2 - Mutual Exclusion

Programming Paradigms for Concurrency Lecture 2 - Mutual Exclusion Programming Paradigms for Concurrency Lecture 2 - Mutual Exclusion Based on companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Modified by Thomas Wies New York University

More information

Fork Sequential Consistency is Blocking

Fork Sequential Consistency is Blocking Fork Sequential Consistency is Blocking Christian Cachin Idit Keidar Alexander Shraer May 14, 2008 Abstract We consider an untrusted server storing shared data on behalf of clients. We show that no storage

More information

! A lock is a mechanism to control concurrent access to a data item! Data items can be locked in two modes :

! A lock is a mechanism to control concurrent access to a data item! Data items can be locked in two modes : Lock-Based Protocols Concurrency Control! A lock is a mechanism to control concurrent access to a data item! Data items can be locked in two modes : 1 exclusive (X) mode Data item can be both read as well

More information

Fork Sequential Consistency is Blocking

Fork Sequential Consistency is Blocking Fork Sequential Consistency is Blocking Christian Cachin Idit Keidar Alexander Shraer Novembe4, 008 Abstract We consider an untrusted server storing shared data on behalf of clients. We show that no storage

More information

Non-blocking Array-based Algorithms for Stacks and Queues. Niloufar Shafiei

Non-blocking Array-based Algorithms for Stacks and Queues. Niloufar Shafiei Non-blocking Array-based Algorithms for Stacks and Queues Niloufar Shafiei Outline Introduction Concurrent stacks and queues Contributions New algorithms New algorithms using bounded counter values Correctness

More information

Review of last lecture. Peer Quiz. DPHPC Overview. Goals of this lecture. Lock-based queue

Review of last lecture. Peer Quiz. DPHPC Overview. Goals of this lecture. Lock-based queue Review of last lecture Design of Parallel and High-Performance Computing Fall 2016 Lecture: Linearizability Motivational video: https://www.youtube.com/watch?v=qx2driqxnbs Instructor: Torsten Hoefler &

More information

Non-blocking Array-based Algorithms for Stacks and Queues!

Non-blocking Array-based Algorithms for Stacks and Queues! Non-blocking Array-based Algorithms for Stacks and Queues! Niloufar Shafiei! Department of Computer Science and Engineering York University ICDCN 09 Outline! Introduction! Stack algorithm! Queue algorithm!

More information

Parallel Computer Architecture Spring Memory Consistency. Nikos Bellas

Parallel Computer Architecture Spring Memory Consistency. Nikos Bellas Parallel Computer Architecture Spring 2018 Memory Consistency Nikos Bellas Computer and Communications Engineering Department University of Thessaly Parallel Computer Architecture 1 Coherence vs Consistency

More information

Potential violations of Serializability: Example 1

Potential violations of Serializability: Example 1 CSCE 6610:Advanced Computer Architecture Review New Amdahl s law A possible idea for a term project Explore my idea about changing frequency based on serial fraction to maintain fixed energy or keep same

More information

Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services

Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services PODC 2004 The PODC Steering Committee is pleased to announce that PODC 2004 will be held in St. John's, Newfoundland. This will be the thirteenth PODC to be held in Canada but the first to be held there

More information

Computing Parable. The Archery Teacher. Courtesy: S. Keshav, U. Waterloo. Computer Science. Lecture 16, page 1

Computing Parable. The Archery Teacher. Courtesy: S. Keshav, U. Waterloo. Computer Science. Lecture 16, page 1 Computing Parable The Archery Teacher Courtesy: S. Keshav, U. Waterloo Lecture 16, page 1 Consistency and Replication Today: Consistency models Data-centric consistency models Client-centric consistency

More information

Release Consistency. Draft material for 3rd edition of Distributed Systems Concepts and Design

Release Consistency. Draft material for 3rd edition of Distributed Systems Concepts and Design Draft material for 3rd edition of Distributed Systems Concepts and Design Department of Computer Science, Queen Mary & Westfield College, University of London Release Consistency 1. Introduction Chapter

More information

Process Management And Synchronization

Process Management And Synchronization Process Management And Synchronization In a single processor multiprogramming system the processor switches between the various jobs until to finish the execution of all jobs. These jobs will share the

More information

arxiv: v1 [cs.dc] 8 May 2017

arxiv: v1 [cs.dc] 8 May 2017 Towards Reduced Instruction Sets for Synchronization arxiv:1705.02808v1 [cs.dc] 8 May 2017 Rati Gelashvili MIT gelash@mit.edu Alexander Spiegelman Technion sashas@tx.technion.ac.il Idit Keidar Technion

More information

Chapter 15 : Concurrency Control

Chapter 15 : Concurrency Control Chapter 15 : Concurrency Control What is concurrency? Multiple 'pieces of code' accessing the same data at the same time Key issue in multi-processor systems (i.e. most computers today) Key issue for parallel

More information

A Comparison of Relativistic and Reader-Writer Locking Approaches to Shared Data Access

A Comparison of Relativistic and Reader-Writer Locking Approaches to Shared Data Access A Comparison of Relativistic and Reader-Writer Locking Approaches to Shared Data Access Philip W. Howard, Josh Triplett, and Jonathan Walpole Portland State University Abstract. This paper explores the

More information

AST: scalable synchronization Supervisors guide 2002

AST: scalable synchronization Supervisors guide 2002 AST: scalable synchronization Supervisors guide 00 tim.harris@cl.cam.ac.uk These are some notes about the topics that I intended the questions to draw on. Do let me know if you find the questions unclear

More information

A class C of objects is universal for some set E of classes if and only if any object in E can be implemented with objects of C (and registers)

A class C of objects is universal for some set E of classes if and only if any object in E can be implemented with objects of C (and registers) Universality A class C of objects is universal for some set E of classes if and only if any object in E can be implemented with objects of C (and registers) n-consensus is universal for n-objects (objects

More information

Lower bounds for Transactional memory

Lower bounds for Transactional memory Lower bounds for Transactional memory Srivatsan Ravi Purdue University Abstract Transactional memory allows the user to declare sequences of instructions as speculative transactions that can either commit

More information

On the Definition of Sequential Consistency

On the Definition of Sequential Consistency On the Definition of Sequential Consistency Ali Sezgin Ganesh Gopalakrishnan Abstract The definition of sequential consistency is compared with an intuitive notion of correctness. A relation between what

More information

Review of last lecture. Goals of this lecture. DPHPC Overview. Lock-based queue. Lock-based queue

Review of last lecture. Goals of this lecture. DPHPC Overview. Lock-based queue. Lock-based queue Review of last lecture Design of Parallel and High-Performance Computing Fall 2013 Lecture: Linearizability Instructor: Torsten Hoefler & Markus Püschel TA: Timo Schneider Cache-coherence is not enough!

More information

Reminder from last time

Reminder from last time Concurrent systems Lecture 5: Concurrency without shared data, composite operations and transactions, and serialisability DrRobert N. M. Watson 1 Reminder from last time Liveness properties Deadlock (requirements;

More information

CS252 Spring 2017 Graduate Computer Architecture. Lecture 15: Synchronization and Memory Models Part 2

CS252 Spring 2017 Graduate Computer Architecture. Lecture 15: Synchronization and Memory Models Part 2 CS252 Spring 2017 Graduate Computer Architecture Lecture 15: Synchronization and Memory Models Part 2 Lisa Wu, Krste Asanovic http://inst.eecs.berkeley.edu/~cs252/sp17 WU UCB CS252 SP17 Project Proposal

More information

Lecture 12: TM, Consistency Models. Topics: TM pathologies, sequential consistency, hw and hw/sw optimizations

Lecture 12: TM, Consistency Models. Topics: TM pathologies, sequential consistency, hw and hw/sw optimizations Lecture 12: TM, Consistency Models Topics: TM pathologies, sequential consistency, hw and hw/sw optimizations 1 Paper on TM Pathologies (ISCA 08) LL: lazy versioning, lazy conflict detection, committing

More information

Advanced Topic: Efficient Synchronization

Advanced Topic: Efficient Synchronization Advanced Topic: Efficient Synchronization Multi-Object Programs What happens when we try to synchronize across multiple objects in a large program? Each object with its own lock, condition variables Is

More information

CS6450: Distributed Systems Lecture 11. Ryan Stutsman

CS6450: Distributed Systems Lecture 11. Ryan Stutsman Strong Consistency CS6450: Distributed Systems Lecture 11 Ryan Stutsman Material taken/derived from Princeton COS-418 materials created by Michael Freedman and Kyle Jamieson at Princeton University. Licensed

More information

Database Tuning and Physical Design: Execution of Transactions

Database Tuning and Physical Design: Execution of Transactions Database Tuning and Physical Design: Execution of Transactions Spring 2018 School of Computer Science University of Waterloo Databases CS348 (University of Waterloo) Transaction Execution 1 / 20 Basics

More information

Last time: Saw how to implement atomicity in the presence of crashes, but only one transaction running at a time

Last time: Saw how to implement atomicity in the presence of crashes, but only one transaction running at a time 6.033 Lecture 17 Isolation 4/9/2014 Last time: Saw how to implement atomicity in the presence of crashes, but only one transaction running at a time [show slides] This time, going to see how we preserve

More information

Synchrony Weakened by Message Adversaries vs Asynchrony Enriched with Failure Detectors. Michel Raynal, Julien Stainer

Synchrony Weakened by Message Adversaries vs Asynchrony Enriched with Failure Detectors. Michel Raynal, Julien Stainer Synchrony Weakened by Message Adversaries vs Asynchrony Enriched with Failure Detectors Michel Raynal, Julien Stainer Synchrony Weakened by Message Adversaries vs Asynchrony Enriched with Failure Detectors

More information

Coordination and Agreement

Coordination and Agreement Coordination and Agreement Nicola Dragoni Embedded Systems Engineering DTU Informatics 1. Introduction 2. Distributed Mutual Exclusion 3. Elections 4. Multicast Communication 5. Consensus and related problems

More information

Lecture 16/17: Distributed Shared Memory. CSC 469H1F Fall 2006 Angela Demke Brown

Lecture 16/17: Distributed Shared Memory. CSC 469H1F Fall 2006 Angela Demke Brown Lecture 16/17: Distributed Shared Memory CSC 469H1F Fall 2006 Angela Demke Brown Outline Review distributed system basics What is distributed shared memory? Design issues and tradeoffs Distributed System

More information

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2002

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2002 CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2002 Lecture 6: Synchronization 6.0 Main points More concurrency examples Synchronization primitives 6.1 A Larger Concurrent

More information

Lecture 21: Transactional Memory. Topics: consistency model recap, introduction to transactional memory

Lecture 21: Transactional Memory. Topics: consistency model recap, introduction to transactional memory Lecture 21: Transactional Memory Topics: consistency model recap, introduction to transactional memory 1 Example Programs Initially, A = B = 0 P1 P2 A = 1 B = 1 if (B == 0) if (A == 0) critical section

More information

The Art of Multiprocessor Programming Copyright 2007 Elsevier Inc. All rights reserved. October 3, 2007 DRAFT COPY

The Art of Multiprocessor Programming Copyright 2007 Elsevier Inc. All rights reserved. October 3, 2007 DRAFT COPY The Art of Multiprocessor Programming Copyright 2007 Elsevier Inc. All rights reserved Maurice Herlihy October 3, 2007 Nir Shavit 2 Contents 1 Introduction 13 1.1 Shared Objects and Synchronization..............

More information

Implementing Isolation

Implementing Isolation CMPUT 391 Database Management Systems Implementing Isolation Textbook: 20 & 21.1 (first edition: 23 & 24.1) University of Alberta 1 Isolation Serial execution: Since each transaction is consistent and

More information

Replication in Distributed Systems

Replication in Distributed Systems Replication in Distributed Systems Replication Basics Multiple copies of data kept in different nodes A set of replicas holding copies of a data Nodes can be physically very close or distributed all over

More information

Memory Consistency Models

Memory Consistency Models Memory Consistency Models Contents of Lecture 3 The need for memory consistency models The uniprocessor model Sequential consistency Relaxed memory models Weak ordering Release consistency Jonas Skeppstedt

More information

Implementing caches. Example. Client. N. America. Client System + Caches. Asia. Client. Africa. Client. Client. Client. Client. Client.

Implementing caches. Example. Client. N. America. Client System + Caches. Asia. Client. Africa. Client. Client. Client. Client. Client. N. America Example Implementing caches Doug Woos Asia System + Caches Africa put (k2, g(get(k1)) put (k2, g(get(k1)) What if clients use a sharded key-value store to coordinate their output? Or CPUs use

More information

Distributed Shared Memory and Memory Consistency Models

Distributed Shared Memory and Memory Consistency Models Lectures on distributed systems Distributed Shared Memory and Memory Consistency Models Paul Krzyzanowski Introduction With conventional SMP systems, multiple processors execute instructions in a single

More information

Interprocess Communication By: Kaushik Vaghani

Interprocess Communication By: Kaushik Vaghani Interprocess Communication By: Kaushik Vaghani Background Race Condition: A situation where several processes access and manipulate the same data concurrently and the outcome of execution depends on the

More information

6.852: Distributed Algorithms Fall, Class 21

6.852: Distributed Algorithms Fall, Class 21 6.852: Distributed Algorithms Fall, 2009 Class 21 Today s plan Wait-free synchronization. The wait-free consensus hierarchy Universality of consensus Reading: [Herlihy, Wait-free synchronization] (Another

More information

Module 7 - Replication

Module 7 - Replication Module 7 - Replication Replication Why replicate? Reliability Avoid single points of failure Performance Scalability in numbers and geographic area Why not replicate? Replication transparency Consistency

More information

Lock-Free and Practical Doubly Linked List-Based Deques using Single-Word Compare-And-Swap

Lock-Free and Practical Doubly Linked List-Based Deques using Single-Word Compare-And-Swap Lock-Free and Practical Doubly Linked List-Based Deques using Single-Word Compare-And-Swap Håkan Sundell Philippas Tsigas OPODIS 2004: The 8th International Conference on Principles of Distributed Systems

More information

Programming Paradigms for Concurrency Lecture 3 Concurrent Objects

Programming Paradigms for Concurrency Lecture 3 Concurrent Objects Programming Paradigms for Concurrency Lecture 3 Concurrent Objects Based on companion slides for The Art of Multiprocessor Programming by Maurice Herlihy & Nir Shavit Modified by Thomas Wies New York University

More information

Quasi-Linearizability Relaxed Consistency For Improved Concurrency

Quasi-Linearizability Relaxed Consistency For Improved Concurrency TEL-AVIV UNIVERSITY RAYMOND AND BEVERLY SACKLER FACULTY OF EXACT SCIENCES SCHOOL OF COMPUTER SCIENCE Quasi-Linearizability Relaxed Consistency For Improved Concurrency Dissertation submitted in partial

More information

The alternator. Mohamed G. Gouda F. Furman Haddix

The alternator. Mohamed G. Gouda F. Furman Haddix Distrib. Comput. (2007) 20:21 28 DOI 10.1007/s00446-007-0033-1 The alternator Mohamed G. Gouda F. Furman Haddix Received: 28 August 1999 / Accepted: 5 July 2000 / Published online: 12 June 2007 Springer-Verlag

More information

Asynchronous Models. Chapter Asynchronous Processes States, Inputs, and Outputs

Asynchronous Models. Chapter Asynchronous Processes States, Inputs, and Outputs Chapter 3 Asynchronous Models 3.1 Asynchronous Processes Like a synchronous reactive component, an asynchronous process interacts with other processes via inputs and outputs, and maintains an internal

More information

Process Synchronization

Process Synchronization CSC 4103 - Operating Systems Spring 2007 Lecture - VI Process Synchronization Tevfik Koşar Louisiana State University February 6 th, 2007 1 Roadmap Process Synchronization The Critical-Section Problem

More information

Replication of Data. Data-Centric Consistency Models. Reliability vs. Availability

Replication of Data. Data-Centric Consistency Models. Reliability vs. Availability CIS 505: Software Systems Lecture Note on Consistency and Replication Instructor: Insup Lee Department of Computer and Information Science University of Pennsylvania CIS 505, Spring 2007 Replication of

More information

Advanced Multiprocessor Programming Project Topics and Requirements

Advanced Multiprocessor Programming Project Topics and Requirements Advanced Multiprocessor Programming Project Topics and Requirements Jesper Larsson Trä TU Wien May 5th, 2017 J. L. Trä AMP SS17, Projects 1 / 21 Projects Goal: Get practical, own experience with concurrent

More information

Self-Stabilization of Wait-Free Shared Memory Objects

Self-Stabilization of Wait-Free Shared Memory Objects Self-Stabilization of Wait-Free Shared Memory Objects Jaap-Henk Hoepman Department of Computer Science University of Twente, the Netherlands hoepman@cs.utwente.nl Marina Papatriantafilou Department of

More information

Shared Memory Synchronization

Shared Memory Synchronization Shared Memory Synchronization Gadi Taubenfeld The Interdisciplinary Center, P.O.Box 167, Herzliya 46150, Israel, tgadi@idc.ac.il, http://www.faculty.idc.ac.il/gadi/ September 1, 2008 Abstract. Synchronization

More information

Lecture-12: Closed Sets

Lecture-12: Closed Sets and Its Examples Properties of Lecture-12: Dr. Department of Mathematics Lovely Professional University Punjab, India October 18, 2014 Outline Introduction and Its Examples Properties of 1 Introduction

More information