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?