Local-spin, Abortable Mutual Exclusion Joe Rideout.

Slides:



Advertisements
Similar presentations
Operating Systems Part III: Process Management (Process Synchronization)
Advertisements

CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Synchronization. How to synchronize processes? – Need to protect access to shared data to avoid problems like race conditions – Typical example: Updating.
CSE 490/590, Spring 2011 CSE 490/590 Computer Architecture Snoopy Caches I Steve Ko Computer Sciences and Engineering University at Buffalo.
Synchronization Algorithms and Concurrent Programming
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
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.
Multiprocessor Synchronization Algorithms ( ) Lecturer: Danny Hendler The Mutual Exclusion problem.
Concurrent Programming James Adkison 02/28/2008. What is concurrency? “happens-before relation – A happens before B if A and B belong to the same process.
Local-Spin Algorithms Multiprocessor synchronization algorithms ( ) Lecturer: Danny Hendler This presentation is based on the book “Synchronization.
Local-Spin Algorithms
Critical Section chapter3.
Chapter 3 The Critical Section Problem
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.
Local-Spin Algorithms Multiprocessor synchronization algorithms ( ) Lecturer: Danny Hendler This presentation is based on the book “Synchronization.
The Performance of Spin Lock Alternatives for Shared-Memory Microprocessors Thomas E. Anderson Presented by David Woodard.
1 Multiprocessors. 2 Idea: create powerful computers by connecting many smaller ones good news: works for timesharing (better than supercomputer) bad.
1 Lecture 21: Synchronization Topics: lock implementations (Sections )
1 Adaptive and Efficient Mutual Exclusion Presented by: By Hagit Attya and Vita Bortnikov Mian Huang.
Concurrency in Distributed Systems: Mutual exclusion.
Local-Spin Algorithms Multiprocessor synchronization algorithms ( ) Lecturer: Danny Hendler This presentation is based on the book “Synchronization.
1 Lecture 20: Protocols and Synchronization Topics: distributed shared-memory multiprocessors, synchronization (Sections )
1 Lecture 9: Synchronization  concurrency examples and the need for synchronization  definition of mutual exclusion (MX)  programming solutions for.
1 Thread Synchronization: Too Much Milk. 2 Implementing Critical Sections in Software Hard The following example will demonstrate the difficulty of providing.
Simple Wait-Free Snapshots for Real-Time Systems with Sporadic Tasks Håkan Sundell Philippas Tsigas.
Understanding Performance of Concurrent Data Structures on Graphics Processors Daniel Cederman, Bapi Chatterjee, Philippas Tsigas Distributed Computing.
Mutual Exclusion Presented by: Rohan Sen (Distributed Algorithms Ch. 10)
6.852: Distributed Algorithms Spring, 2008 Class 13.
THIRD PART Algorithms for Concurrent Distributed Systems: The Mutual Exclusion problem.
DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE
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.
Mutual Exclusion A History. Agenda Model Registers History.
O(log n / log log n) RMRs Randomized Mutual Exclusion Danny Hendler Philipp Woelfel PODC 2009 Ben-Gurion University University of Calgary.
1 Shared Memory. 2 processes 3 Types of Shared Variables Read/Write Test & Set Read-Modify-Write.
Complexity Implications of Memory Models. Out-of-Order Execution Avoid with fences (and atomic operations) Shared memory processes reordering buffer Hagit.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-5 Process Synchronization Department of Computer Science and Software.
1 Lecture 19: Scalable Protocols & Synch Topics: coherence protocols for distributed shared-memory multiprocessors and synchronization (Sections )
CIS 720 Lecture 5. Techniques to avoid interference Disjoint variables –If the write set of each process is disjoint from the read and write set of other.
Local-Spin Mutual Exclusion Multiprocessor synchronization algorithms ( ) Lecturer: Danny Hendler This presentation is based on the book “Synchronization.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
1 Critical Section Problem CIS 450 Winter 2003 Professor Jinhua Guo.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
Hwajung Lee. Mutual Exclusion CS p0 p1 p2 p3 Some applications are:  Resource sharing  Avoiding concurrent update on shared data  Controlling the.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Process Synchronization Presentation 2 Group A4: Sean Hudson, Syeda Taib, Manasi Kapadia.
Synchronization Questions answered in this lecture: Why is synchronization necessary? What are race conditions, critical sections, and atomic operations?
Multiprocessors – Locks
Wait-Free Consensus CPSC 661 Fall 2003 Supervised by: Lisa Higham
Bakery Algorithm - Proof
O(log n / log log n) RMRs Randomized Mutual Exclusion
Lecture 18: Coherence and Synchronization
Reactive Synchronization Algorithms for Multiprocessors
O(log n / log log n) RMRs Randomized Mutual Exclusion
Designing Parallel Algorithms (Synchronization)
Course Syllabus 1. Introduction - History; Views; Concepts; Structure
Lecture: Coherence and Synchronization
Course Syllabus 1. Introduction - History; Views; Concepts; Structure
Multiprocessor Synchronization Algorithms ( )
Course Syllabus 1. Introduction - History; Views; Concepts; Structure
ITEC452 Distributed Computing Lecture 7 Mutual Exclusion
Course Syllabus 1. Introduction - History; Views; Concepts; Structure
Lecture 19: Coherence and Synchronization
Lecture 18: Coherence and Synchronization
Course Syllabus 1. Introduction - History; Views; Concepts; Structure
Syllabus 1. Introduction - History; Views; Concepts; Structure
Don Porter Portions courtesy Emmett Witchel
Presentation transcript:

Local-spin, Abortable Mutual Exclusion Joe Rideout

Outline Review - Mutual Exclusion Current themes Measuring efficiency Abortability Summary of current results Open problems Summary

Outline Review - Mutual ExclusionReview - Mutual Exclusion Current themes Measuring efficiency Abortability Summary of current results Open problems Summary

Mutual Exclusion a shared resource of critical importance should be used by at most one person at any one time! (exclusion) if someone is waiting to get in, he/she should eventually get access (starvation- freedom)

A Violation of Mutual Exclusion

More formally… Exclusion - If a process p is in the CS, then no process q≠p is in the CS concurrently with p. Starvation Freedom - If a process p enters the trying protocol, then p eventually enters the CS Bounded Exit - If a process enters the EP, it returns to the NCS in a bounded number of its own steps. while true do Noncritical Section (NCS); Entry Section; Critical Section (CS); Exit Protocol (EP) od

Early Solutions Dijkstra, Livelock free Knuth, Starvation free Lamport, Bakery Algorithm

Outline Review - Mutual Exclusion Current themesCurrent themes Measuring efficiency Abortability Summary of current results Open problems Summary

Hasn’t this been solved? Time efficiency Local-spin, “fast” and adaptive mutual exclusion Use of primitives Read/Write vs. Read-modify-write Variations Group and abortable mutual exclusion

Hasn’t this been solved? Time efficiency Local-spin, “fast” and adaptive mutual exclusion Use of primitives Read/Write vs. Read-modify-write Variations Group and abortable mutual exclusion

Outline Review - Mutual Exclusion Recent themes Measuring efficiencyMeasuring efficiency Abortability Summary of current results Open problems Summary

Time Complexity What is a good measure of efficiency? Number of steps taken in entry/exit sections? No. Busy-waiting will make these unbounded. Better: number of remote memory references

Two architectural Paradigms

Remote Memory References (RMR) References that cause an interconnect traversal In DSM… reading/writing the memory of another process In CC… writing or reading an updated value We speak of RMR time complexity

Local-spin A mutual exclusion algorithm is local- spin if it makes a bounded number of RMRs in its entry and exit protocols In other words, “spin variables” that are repeatedly tested must be local or locally cached

Outline Review - Mutual Exclusion Recent themes Measuring efficiency AbortabilityAbortability Summary of current results Open problems Summary

Abortable Mutual Exclusion A process can abort its attempt to acquire a lock Need arises in database and realtime systems Bounded abort - after a process p enters the Abort section it leaves the Abort section within a bounded number of its own steps.

Outline Review - Mutual Exclusion Recent themes Measuring efficiency Abortability Summary of current resultsSummary of current results Open problems Summary

Current Results Read/WriteRead-modify-write Local-spinO(logN) RMR † O(1) RMR ‡ Abortable / Local-spin ?O(logN) RMR ¥ † J.-H. Yang and J. Anderson. A fast, scalable mutual exclusion algorithm. Distributed Computing, 9(1):51- 60, August ‡ J. Mellor-Crummey and M. Scott. Algorithms for scalable synchronization on shared-memory multi- processors. ACM Transactions on Computer Systems, 9(1):21-65, Februaru ¥ P. Jayanti. Adaptive and Efficient Abortable Mutual Exclusion. Proceedings of the 22nd Annual Symposium on Principles of Distributed Computing, July 2003,

Current Results + Lower Bounds Read/WriteRead-modify-write Local-spinO(logN) RMR Ω(logN/loglogN) † O(1) RMR Ω(1) Abortable / Local-spin ? Ω(logN/loglogN) † O(logN) RMR Ω(1) † J. Anderson and Y,-J. Kim. An improved lower bound for the time complexity of mutual exclusion. In Proceedings of the 20th Annual ACM Symposium on Principles of Distributed Computing, pages 90-99, August 2001.

Outline Review - Mutual Exclusion Recent themes Measuring efficiency Abortability Summary of current results Open problemsOpen problems Summary

Open Problems Abortable mutual exclusion with O(1) RMR using read-modify-write primitives? Ω(logN) RMR lower bound for mutual exclusion using only read/write primitives? Abortable mutual exclusion with O(logN) RMR using only read/write primitives Modify the Yang-Anderson algorithm?

Open Problems Abortable mutual exclusion with O(1) RMR using read-modify-write primitives? Ω(logN) RMR lower bound for mutual exclusion using only read/write primitives? Abortable mutual exclusion with O(logN) RMR using only read/write primitives Modify the Yang-Anderson algorithm?

Outline Review - Mutual Exclusion Recent themes Measuring efficiency Abortability Summary of current results Open problems SummarySummary

Summary Mutual exclusion - classic but not dead Efficiency - RMR and local-spin Abortable - a property of interest Primitives - Read/Write vs. other Q: Can local-spin abortable mutual exclusion be achieved using only atomic reads and writes?