Lecture 1: Introduction

Slides:



Advertisements
Similar presentations
Symmetric Multiprocessors: Synchronization and Sequential Consistency.
Advertisements

Mutual Exclusion – SW & HW By Oded Regev. Outline: Short review on the Bakery algorithm Short review on the Bakery algorithm Black & White Algorithm Black.
Operating Systems Part III: Process Management (Process Synchronization)
Impossibilities for Disjoint-Access Parallel Transactional Memory : Alessia Milani [Guerraoui & Kapalka, SPAA 08] [Attiya, Hillel & Milani, SPAA 09]
Synchronization. How to synchronize processes? – Need to protect access to shared data to avoid problems like race conditions – Typical example: Updating.
© 2005 P. Kouznetsov Computing with Reads and Writes in the Absence of Step Contention Hagit Attiya Rachid Guerraoui Petr Kouznetsov School of Computer.
1 Chapter 4 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization.
Synchronization Algorithms and Concurrent Programming
A Completeness theorem for a class of synchronization objects Afek.Y, Weisberger.E, Weisman.H Presented by: Reut Schwartz.
1 ITCS 3181 Logic and Computer Systems B. Wilkinson Slides9.ppt Modification date: March 30, 2015 Processor Design.
Synchronization Algorithms and Concurrent Programming
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Process Synchronization Continued 7.2 The Critical-Section Problem.
Mutual Exclusion By Shiran Mizrahi. Critical Section class Counter { private int value = 1; //counter starts at one public Counter(int c) { //constructor.
1 Chapter 2 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld.
Lecture 5 Concurrency and Process/Thread Synchronization     Mutual Exclusion         Dekker's Algorithm         Lamport's Bakery Algorithm.
Chapter 6 Process Synchronization Bernard Chen Spring 2007.
Chapter 6: Process Synchronization
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 5: Process Synchronization.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Multiprocessor Synchronization Algorithms ( ) Lecturer: Danny Hendler The Mutual Exclusion problem.
Process Synchronization. Module 6: Process Synchronization Background The Critical-Section Problem Peterson’s Solution Synchronization Hardware Semaphores.
Mutual Exclusion.
Critical Section chapter3.
1 Chapter 3 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization.
Parallel Processing (CS526) Spring 2012(Week 6).  A parallel algorithm is a group of partitioned tasks that work with each other to solve a large problem.
1 Lecture 1 Distributed Algorithms Gadi Taubenfeld © 2011 Distributed Algorithms Gadi Taubenfeld Lecture 1 INTRODUCTION.
CS510 Advanced OS Seminar Class 10 A Methodology for Implementing Highly Concurrent Data Objects by Maurice Herlihy.
1 Adaptive and Efficient Mutual Exclusion Presented by: By Hagit Attya and Vita Bortnikov Mian Huang.
1 Concurrency: Deadlock and Starvation Chapter 6.
Race Conditions CS550 Operating Systems. Review So far, we have discussed Processes and Threads and talked about multithreading and MPI processes by example.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems Process Synchronization.
Software Transactional Memory for Dynamic-Sized Data Structures Maurice Herlihy, Victor Luchangco, Mark Moir, William Scherer Presented by: Gokul Soundararajan.
Copyright 2007 Sun Microsystems, Inc SNZI: Scalable Non-Zero Indicator Yossi Lev (Brown University & Sun Microsystems Laboratories) Joint work with: Faith.
The Performance of Spin Lock Alternatives for Shared-Memory Multiprocessors THOMAS E. ANDERSON Presented by Daesung Park.
1 Chapter 9 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization.
1 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization.
Mutual Exclusion Using Atomic Registers Lecturer: Netanel Dahan Instructor: Prof. Yehuda Afek B.Sc. Seminar on Distributed Computation Tel-Aviv University.
1 Chapter 2 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization.
Operating Systems CMPSC 473 Mutual Exclusion Lecture 11: October 5, 2010 Instructor: Bhuvan Urgaonkar.
Monitors and Blocking Synchronization Dalia Cohn Alperovich Based on “The Art of Multiprocessor Programming” by Herlihy & Shavit, chapter 8.
Lecture 3 Concurrency and Thread Synchronization     Mutual Exclusion         Dekker's Algorithm         Lamport's Bakery Algorithm.
1 Critical Section Problem CIS 450 Winter 2003 Professor Jinhua Guo.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 6: Process Synchronization.
Lecture 11: Coordination and Agreement Central server for mutual exclusion Election – getting a number of processes to agree which is “in charge” CDK4:
Multiprocessors – Locks
Bakery Algorithm - Proof
Transactions and Reliability
Process Synchronization
Background on the need for Synchronization
Faster Data Structures in Transactional Memory using Three Paths
Lecture 18: Coherence and Synchronization
O(log n / log log n) RMRs Randomized Mutual Exclusion
Chapter 5: Process Synchronization
143a discussion session week 3
Designing Parallel Algorithms (Synchronization)
Threading And Parallel Programming Constructs
Module 7a: Classic Synchronization
Lecture 2 Part 2 Process Synchronization
Grades.
Semaphores Chapter 6.
Chapter 6: Process Synchronization
Lecture 10: Coordination and Agreement
Multiprocessor Synchronization Algorithms ( )
CSE 153 Design of Operating Systems Winter 19
CS333 Intro to Operating Systems
Chapter 6: Synchronization Tools
Lecture 11: Coordination and Agreement
Lecture 19: Coherence and Synchronization
CSE 542: Operating Systems
Presentation transcript:

Lecture 1: Introduction Efficient Transformation of Obstruction-free Algorithms into Non-blocking Algorithms Gadi Taubenfeld Obstruction-freedom Non-blocking Wait-freedom DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Lecture 1: Introduction Efficient Transformation of Obstruction-free Algorithms into Non-blocking Algorithms A note on the use of these ppt slides: I am making these slides freely available to all (faculty, students, readers). They are in PowerPoint form so you can add, modify, and delete slides and slide content to suit your needs. They obviously represent a lot of work on my part. In return for use, I only ask the following: That you mention their source, after all, I would like people to know that I have prepared the presentation. That you note that they are adapted from (or perhaps identical to) my slides, and note my copyright of this material. Thanks and enjoy! Gadi Taubenfeld All material copyright 2007 Gadi Taubenfeld, All Rights Reserved To get the most updated version of these slides go to: http://www.faculty.idc.ac.il/gadi/Publications.htm DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Lock-based Data Structures P1 P2 P3 P4 Entry Critical Section Sequential Data Structure Exit Sequential Bottleneck fault-free solution only locks are the de facto mechanism for concurrency control ! DISC 2007 Gadi Taubenfeld © Sept. 2007

Lock-free Data Structures Lecture 1: Introduction Lock-free Data Structures Obstruction-freedom Non-blocking Wait-freedom Fault-tolerant solutions DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Obstruction-freedom P1 P2 P3 P4 Done DISC 2007 Gadi Taubenfeld © Sept. 2007

Lecture 1: Introduction Obstruction-freedom P1 P2 P3 P4 Instruction: click only after process 2 (the slowest) completes one round, otherwise the transition will not be not smooth. DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Lecture 1: Introduction Non-blocking P1 P2 P3 P4 Instruction: click only after process 3 (the slowest) completes *exectly* one round, in order for the transition to be smooth. Done DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Lecture 1: Introduction Non-blocking P1 P2 P3 P4 Instruction: click only after process 2 (the slowest) completes one round, otherwise the transition will not be not smooth. DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Lecture 1: Introduction Wait-freedom P1 P2 P3 P4 Instruction: click only after process 2 (the slowest) completes one round, otherwise the transition will not be not smooth. DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Lecture 1: Introduction Wait-freedom P1 P2 P3 P4 Done Done Done Done DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Lock-free Data Structures Lecture 1: Introduction Lock-free Data Structures Obstruction-freedom Non-blocking Wait-freedom too weak progress condition not complex strong enough not so complex strong/desirable complex/less efficient DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Transformations & Results Lecture 1: Introduction Transformations & Results Obstruction-freedom The FLMS Transformation wait-freedom non-blocking New DISC 2005: Faith Ellen Fich, Victor Luchangco, Mark Moir, Nir Shavit Space: 2n registers + 1 fetch&increment object Our results: Define a time complexity measure Show that the FLMS Transformation is exponential New transformations with O(1) time complexity Space: n registers + 1 compare&swap object DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Transformations & Results Lecture 1: Introduction Transformations & Results Obstruction-freedom Exponential wait-freedom non-blocking O(1) ? Open: Is there an efficient transformation? DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Unknown-bound semi-synchronous model Lecture 1: Introduction Unknown-bound semi-synchronous model There is an unknown bound on memory access time, or Some unknown bound exists on the relative execution rates of any two processes. All practical system satisfy the unknown-bound assumption.  A process can delay itself for increasingly longer periods, and by doing so it can ensures that other processes will take enough steps. DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Lecture 1: Introduction Time complexity (Synchronization complexity) Obstruction-freedom wait-freedom non-blocking The FLMS Transformation New Given an algorithm divide its steps into three disjoint sets: A – synchronization steps; B – real work steps; C – inexpensive steps. Mutual exclusion A – entry + exit ; B – critical section; C – all other steps. Transformations: A – access to shared memory ; B – steps of the obstruction-free alg ; C – all other steps. DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Lecture 1: Introduction Time complexity P1 P2 A process is enabled if its next step or its last step is from B. The max # of steps from A that a process need to take until it becomes enabled since the last time some process has been enabled. time Given an algorithm divide it steps … A – synchronization steps; B – real work steps; C – inexpensive steps. A single run DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

The time complexity of the FLMS transformation Lecture 1: Introduction The time complexity of the FLMS transformation Obstruction-freedom The FLMS Transformation wait-freedom P1 P2 Pn no process is enabled Pn accesses the shared memory at least 2n-1 x n times in this interval. Pn is enabled . . . time A single run DISC 2007 Gadi Taubenfeld © Sept. 2007 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2006

Our Transformation P1 P2 Obstruction-free algorithm Entry Many ideas are from the FLMS paper! P1 P2 We start by assuming a fault-free-model Can use a single lock Expensive when there is no contention Obstruction-free algorithm Entry Critical Section Exit Obstruction-free algorithm DISC 2007 Gadi Taubenfeld © Sept. 2007

Our Transformation P1 P2 Obstruction-free algorithm Entry Many ideas are from the FLMS paper! P1 P2 We start by assuming a fault-free-model Can use a single lock Expensive when there is no contention Obstruction-free algorithm Tries for X steps … Entry Critical Section Exit Obstruction-free algorithm DISC 2007 Gadi Taubenfeld © Sept. 2007

Our Transformation P1 P2 Obstruction-free algorithm Entry Many ideas are from the FLMS paper! P1 P2 We start by assuming a fault-free-model Can use a single lock Expensive when there is no contention Obstruction-free algorithm Tries for X steps … Problem? Entry Critical Section Exit No problem. Obstruction-free algorithm DISC 2007 Gadi Taubenfeld © Sept. 2007

Observation Obstruction-freedom is useful even when using locking! algorithm Entry Critical Section Exit Entry Critical Section Exit Sequential algorithm Obstruction-free algorithm Sequential locking Obstruction-free locking DISC 2007 Gadi Taubenfeld © Sept. 2007

Our Transformation P1 P2 Obstruction-free algorithm Entry Back to the lock-free model P1 P2 The winner increment a counter C every X steps of the OF algorithm. A loser, p, delays itself for C time units. Obstruction-free algorithm if C was updated p delays again, otherwise, p releases the lock. Entry Critical Section Exit Problems: 1. the winner may be alive; 2. two processes hold the lock; 3. p may release the lock at some unexpected time later on. Obstruction-free algorithm DISC 2007 Gadi Taubenfeld © Sept. 2007

Our Transformation P1 P2 Obstruction-free algorithm Entry Solution -- not so simple … P1 P2 The winner tries to acquire the lock again. But, before doing so, it has to wait long enough so that other processes that have mistakenly concluded that it has crashed will have enough time to release the lock again … Obstruction-free algorithm Entry Critical Section Exit Problems: 1. the winner may be alive; 2. two processes hold the lock; 3. p may release the lock at some unexpected time later on. Obstruction-free algorithm DISC 2007 Gadi Taubenfeld © Sept. 2007

The End DISC 2007 Gadi Taubenfeld © Sept. 2007