Simple Wait-Free Snapshots for Real-Time Systems with Sporadic Tasks Håkan Sundell Philippas Tsigas.

Slides:



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

1 Interprocess Communication 1. Ways of passing information 2. Guarded critical activities (e.g. updating shared data) 3. Proper sequencing in case of.
Fast and Lock-Free Concurrent Priority Queues for Multi-Thread Systems Håkan Sundell Philippas Tsigas.
Operating Systems Part III: Process Management (Process Synchronization)
Håkan Sundell, Chalmers University of Technology 1 Evaluating the performance of wait-free snapshots in real-time systems Björn Allvin.
Concurrency: Deadlock and Starvation Chapter 6. Deadlock Permanent blocking of a set of processes that either compete for system resources or communicate.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Previously… Processes –Process States –Context Switching –Process Queues Threads –Thread Mappings Scheduling –FCFS –SJF –Priority scheduling –Round Robin.
Chapter 6: Process Synchronization
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 6: Process Synchronization.
Process Synchronization. Module 6: Process Synchronization Background The Critical-Section Problem Peterson’s Solution Synchronization Hardware Semaphores.
Scalable and Lock-Free Concurrent Dictionaries
Wait-Free Reference Counting and Memory Management Håkan Sundell, Ph.D.
Håkan Sundell, Chalmers University of Technology 1 Space Efficient Wait-free Buffer Sharing in Multiprocessor Real-time Systems Based.
CPSC 668Set 6: Mutual Exclusion in Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
“THREADS CANNOT BE IMPLEMENTED AS A LIBRARY” HANS-J. BOEHM, HP LABS Presented by Seema Saijpaul CS-510.
Lock-free Cuckoo Hashing Nhan Nguyen & Philippas Tsigas ICDCS 2014 Distributed Computing and Systems Chalmers University of Technology Gothenburg, Sweden.
Concurrency: Mutual Exclusion and Synchronization Why we need Mutual Exclusion? Classical examples: Bank Transactions:Read Account (A); Compute A = A +
Introduction to Lock-free Data-structures and algorithms Micah J Best May 14/09.
CS510 Advanced OS Seminar Class 10 A Methodology for Implementing Highly Concurrent Data Objects by Maurice Herlihy.
1 Concurrency: Deadlock and Starvation Chapter 6.
Company LOGO Lock-free and Wait-free Slot Scheduling Algorithms Pooja Aggarwal Smruti R. Sarangi Computer Science, IIT Delhi, India 1.
Operating Systems CSE 411 CPU Management Oct Lecture 13 Instructor: Bhuvan Urgaonkar.
Synchronization Methods for Multicore Programming Brendan Lynch.
Concurrency: Deadlock and Starvation Chapter 6. Goal and approach Deadlock and starvation Underlying principles Solutions? –Prevention –Detection –Avoidance.
1 Lock-Free Linked Lists Using Compare-and-Swap by John Valois Speaker’s Name: Talk Title: Larry Bush.
Practical and Lock-Free Doubly Linked Lists Håkan Sundell Philippas Tsigas.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings 1.
Parallel Programming Philippas Tsigas Chalmers University of Technology Computer Science and Engineering Department © Philippas Tsigas.
Chapter 6 Process Synchronization Copyright © 2008.
Håkan Sundell, Chalmers University of Technology 1 Using Timing Information on Wait-Free Algorithms in Real-Time Systems (2 papers)
Concurrency, Mutual Exclusion and Synchronization.
Håkan Sundell, Chalmers University of Technology 1 NOBLE: A Non-Blocking Inter-Process Communication Library Håkan Sundell Philippas.
Håkan Sundell, Chalmers University of Technology 1 Applications of Non-Blocking Data Structures to Real-Time Systems Seminar for the.
6.3 Peterson’s Solution The two processes share two variables: Int turn; Boolean flag[2] The variable turn indicates whose turn it is to enter the critical.
Håkan Sundell, Chalmers University of Technology 1 Simple and Fast Wait-Free Snapshots for Real-Time Systems Håkan Sundell Philippas.
A Consistency Framework for Iteration Operations in Concurrent Data Structures Yiannis Nikolakopoulos A. Gidenstam M. Papatriantafilou P. Tsigas Distributed.
Challenges in Non-Blocking Synchronization Håkan Sundell, Ph.D. Guest seminar at Department of Computer Science, University of Tromsö, Norway, 8 Dec 2005.
Non-blocking Data Structures for High- Performance Computing Håkan Sundell, PhD.
Maged M.Michael Michael L.Scott Department of Computer Science Univeristy of Rochester Presented by: Jun Miao.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
1 Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
1 Contention Management and Obstruction-free Algorithms Niloufar Shafiei.
DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE
Chapter 6 – Process Synchronisation (Pgs 225 – 267)
CSE 425: Concurrency II Semaphores and Mutexes Can avoid bad inter-leavings by acquiring locks –Guard access to a shared resource to take turns using it.
Wait-Free Multi-Word Compare- And-Swap using Greedy Helping and Grabbing Håkan Sundell PDPTA 2009.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-5 Process Synchronization Department of Computer Science and Software.
Operating Systems CSE 411 CPU Management Dec Lecture Instructor: Bhuvan Urgaonkar.
CS510 Concurrent Systems Jonathan Walpole. RCU Usage in Linux.
Slides created by: Professor Ian G. Harris Operating Systems  Allow the processor to perform several tasks at virtually the same time Ex. Web Controlled.
CSCI1600: Embedded and Real Time Software Lecture 17: Concurrent Programming Steven Reiss, Fall 2015.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 6: Process Synchronization.
Semaphores Chapter 6. Semaphores are a simple, but successful and widely used, construct.
Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Process Synchronization
Background on the need for Synchronization
Concurrent Processes.
Håkan Sundell Philippas Tsigas
A Lock-Free Algorithm for Concurrent Bags
Anders Gidenstam Håkan Sundell Philippas Tsigas
NOBLE: A Non-Blocking Inter-Process Communication Library
Semaphores Chapter 6.
CSCI1600: Embedded and Real Time Software
Kernel Synchronization II
CSCI1600: Embedded and Real Time Software
CSE 542: Operating Systems
Presentation transcript:

Simple Wait-Free Snapshots for Real-Time Systems with Sporadic Tasks Håkan Sundell Philippas Tsigas

2 Outline Real-Time System Snapshot Synchronization Methods Algorithm New version after Bounding Experiments Conclusions

3 Real-Time System Multiprocessor system Interconnection Network Shared memory Scheduler Periodic Tasks Sporadic Tasks CPU

4 Snapshot – Shared Data Structure Shared variables Snapshot A consistent momentous state of a set of related shared variables In this paper: One reader (scanner) Reads the whole set of variables in one atomic step Many writers (updaters) Writes to only one variable each time

5 Synchronization Shared data structures needs synchronization Synchronization using Locks Mutually exclusive access to whole or parts of the data structure P1 P2 P3 P1 P2 P3

6 Blocking Synchronization Drawbacks Blocking Priority Inversion Risk of deadlock Locks: Semaphores, spinning, disabling interrupts etc. Reduced efficiency because of reduced parallelism

7 Non-blocking Synchronization Lock-Free Synchronization Optimistic approach (i.e. assumes no interference) 1.The operation is prepared to later take effect (unless interfered) using hardware atomic primitives 2.Possible interference is detected via the atomic primitives, and causes a retry Can cause starvation Wait-Free Synchronization The operation always finishes in a finite number of its own steps.

8 Non-blocking Synchronization Lock-Free Synchronization Avoids problems with locks Simple algorithms Fast when having low contention Wait-Free Synchronization Always finishes in a finite number of its own steps. Complex algorithms Memory consuming Less efficient in average than lock-free

9 Linearizability For every concurrent execution there should exist an equal and valid sequential execution that respects the partial order of the operations in the concurrent execution t Read Write T i : T j : T k : Sequential :

10 Linearizability for Snapshots Atomicity / Linearizability criteria Write cici cjcj t NO t t Write Read Write Read YES cici cici = returned by scanner

11 Linearizability for Snapshots Atomicity / Linearizability criteria t Write Read cici t Write Read cici NO = returned by scanner

12 Algorithm Wait-Free Snapshot Algorithm [Kirousis et al.] Unbounded Memory t v????wnil v????w v????w c1c1 cici c Snapshotindex ? = previous values / nil w = writer position … … …

13 Bounding We must recycle the array indexes in some way Keep track of the scanner versus the updaters’ positions. Make sure that the updaters’ positions are always behind the scanner so that new positions are always free Previous general solution [Ermedahl et al.] Synchronized using atomic Test-and-Set hardware primitives Single updater per component

14 Bounding in Real-Time Systems Assuming system with periodic or sporadic tasks Use notations from Standard Real-Time Response Time Analysis Use timing information about Periods, T Worst-case Computation time, C Worst-case Response times, R - for fixed priority scheduling

15 Bounding in Real-Time Systems Needed buffer length is dependent on how fast the updaters is compared to the scanner Each component can have different buffer lengths

16 Bounding in Real-Time Systems Needed buffer length for component k : where T s is the period for the scanner task R w is the response time for the updater tasks R s is the response time for the scanner task

17 Experiments Using a Sun Enterprise multiprocessor computer 1 scanner task and 10 updater tasks, one on each cpu Comparing two wait-free snapshot algorithms Using timing information Using test and set synchronization

18 Experiments Measuring response time for scan versus update operations All updaters have the same period All 10 components have the same buffer lengths for the algorithm using timing information The algorithm using Test-and-Set synchronization uses a buffer of length 3

19 Experiments 7 different scenarios ScenarioScan Period (  s) Update Period (  s) Buffer Length

20 Experiments

21 Experiments

22 Conclusions Update operation Using timing information gives up to 400 % better performance Scan operation Using timing information gives up to 20 % better performance in common practical scenarios Update operation is much more frequent than Scan Timing information can improve the performance significantly Simpler algorithm

23 Questions? Contact Information: Address: Håkan Sundell vs. Philippas Tsigas Computing Science Chalmers University of Technology cs.chalmers.se Web: