Håkan Sundell, Chalmers University of Technology 1 Space Efficient Wait-free Buffer Sharing in Multiprocessor Real-time Systems Based.

Slides:



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

Chapter 5 Concurrency: Mutual Exclusion and Synchronization Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee.
Priority INHERITANCE PROTOCOLS
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.
CAS3SH3 Midterm Review. The midterm 50 min, Friday, Feb 27 th Materials through CPU scheduling closed book, closed note Types of questions: True & False,
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Chapter 6: 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.
Interprocess Communication
Scalable and Lock-Free Concurrent Dictionaries
Wait-Free Reference Counting and Memory Management Håkan Sundell, Ph.D.
Concurrent Data Structures in Architectures with Limited Shared Memory Support Ivan Walulya Yiannis Nikolakopoulos Marina Papatriantafilou Philippas Tsigas.
Multi-Object Synchronization. Main Points Problems with synchronizing multiple objects Definition of deadlock – Circular waiting for resources Conditions.
Avishai Wool lecture Introduction to Systems Programming Lecture 4 Inter-Process / Inter-Thread Communication.
6: Process Synchronization 1 1 PROCESS SYNCHRONIZATION I This is about getting processes to coordinate with each other. How do processes work with resources.
TxLinux: Using and Managing Hardware Transactional Memory in an Operating System Christopher J. Rossbach, Owen S. Hofmann, Donald E. Porter, Hany E. Ramadan,
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
1 Concurrency: Deadlock and Starvation Chapter 6.
CS533 - Concepts of Operating Systems 1 CS533 Concepts of Operating Systems Class 8 Synchronization on Multiprocessors.
Concurrency: Deadlock and Starvation Chapter 6. Goal and approach Deadlock and starvation Underlying principles Solutions? –Prevention –Detection –Avoidance.
1 Concurrency: Deadlock and Starvation Chapter 6.
Practical and Lock-Free Doubly Linked Lists Håkan Sundell Philippas Tsigas.
Chapter 6 Concurrency: Deadlock and Starvation Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic,
Parallel Programming Philippas Tsigas Chalmers University of Technology Computer Science and Engineering Department © Philippas Tsigas.
Simple Wait-Free Snapshots for Real-Time Systems with Sporadic Tasks Håkan Sundell Philippas Tsigas.
Håkan Sundell, Chalmers University of Technology 1 Using Timing Information on Wait-Free Algorithms in Real-Time Systems (2 papers)
Quantifying the Sub-optimality of Non-preemptive Real-time Scheduling Abhilash Thekkilakattil, Radu Dobrin and Sasikumar Punnekkat.
Håkan Sundell, Chalmers University of Technology 1 NOBLE: A Non-Blocking Inter-Process Communication Library Håkan Sundell Philippas.
Joseph Cordina 1/11 The Use of Model-Checking for the Verification of Concurrent Algorithms Joseph Cordina Department of C.S.&A.I.
Håkan Sundell, Chalmers University of Technology 1 Applications of Non-Blocking Data Structures to Real-Time Systems Seminar for the.
ECE200 – Computer Organization Chapter 9 – Multiprocessors.
Håkan Sundell, Chalmers University of Technology 1 Simple and Fast Wait-Free Snapshots for Real-Time Systems Håkan Sundell Philippas.
Challenges in Non-Blocking Synchronization Håkan Sundell, Ph.D. Guest seminar at Department of Computer Science, University of Tromsö, Norway, 8 Dec 2005.
Maged M.Michael Michael L.Scott Department of Computer Science Univeristy of Rochester Presented by: Jun Miao.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Kernel Locking Techniques by Robert Love presented by Scott Price.
Chapter 6 – Process Synchronisation (Pgs 225 – 267)
Wait-Free Multi-Word Compare- And-Swap using Greedy Helping and Grabbing Håkan Sundell PDPTA 2009.
CS510 Concurrent Systems Jonathan Walpole. RCU Usage in Linux.
Concurrency in Shared Memory Systems Synchronization and Mutual Exclusion.
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.
Mutual Exclusion -- Addendum. Mutual Exclusion in Critical Sections.
REAL-TIME OPERATING SYSTEMS
PROCESS MANAGEMENT IN MACH
Background on the need for Synchronization
Håkan Sundell Philippas Tsigas
A Lock-Free Algorithm for Concurrent Bags
Anders Gidenstam Håkan Sundell Philippas Tsigas
COP 4600 Operating Systems Fall 2010
COMS Prelim 1 Review Session
Module 7a: Classic Synchronization
Christopher J. Rossbach, Owen S. Hofmann, Donald E. Porter, Hany E
Yiannis Nikolakopoulos
NOBLE: A Non-Blocking Inter-Process Communication Library
Semaphores Chapter 6.
CSCI1600: Embedded and Real Time Software
CSE 451: Operating Systems Autumn 2003 Lecture 7 Synchronization
CSE 451: Operating Systems Autumn 2005 Lecture 7 Synchronization
CSE 451: Operating Systems Winter 2003 Lecture 7 Synchronization
CSCI1600: Embedded and Real Time Software
Presentation transcript:

Håkan Sundell, Chalmers University of Technology 1 Space Efficient Wait-free Buffer Sharing in Multiprocessor Real-time Systems Based on Timing Information Håkan Sundell Philippas Tsigas Computing Science Chalmers University of Technology

Håkan Sundell, Chalmers University of Technology 2 Schedule Real-Time System Synchronization Algorithm Bounding Examples Conclusions Future work

Håkan Sundell, Chalmers University of Technology 3 Real-Time System Multiprocessor system Interconnection Network Shared memory, possibly non- uniform CPU

Håkan Sundell, Chalmers University of Technology 4 Real-Time System Cooperating Tasks Timing constraints Need synchronization –Shared Data Objects In this paper: Atomic Shared Buffer

Håkan Sundell, Chalmers University of Technology 5 Synchronization Synchronization methods –Lock Uses semaphores, spinning, disabling interrupts Negative –Blocking –Priority inversion –Risk of deadlock Positive –Execution time guarantees easy to do, but pessimistic Take lock... do operation... Release lock

Håkan Sundell, Chalmers University of Technology 6 Synchronization Synchronization methods –Lock-free Retries until not interfered by other operations Usually uses some kind of shared flag variable Write flag with unique value... do operation... Check flag value and maybe retry

Håkan Sundell, Chalmers University of Technology 7 Synchronization Synchronization methods –Lock-free Negative –No execution time guarantees, can continue forever - thus can cause starvation Positive –Avoids blocking and priority inversion –Avoids deadlock –Fast execution when low contention

Håkan Sundell, Chalmers University of Technology 8 Synchronization Synchronization methods –Wait-free Uses atomic synchronization primitives Uses shared memory Negative –Complex algorithms –Memory consuming Test&SetCompare&SwapCopyingHelpingAnnouncingSplitoperation???

Håkan Sundell, Chalmers University of Technology 9 Synchronization Synchronization methods –Wait-free Positive –Execution time guarantees –Fast execution –Avoids blocking and priority inversion –Avoids deadlock –Avoids starvation –Same implementation on both single- and multiprocessor systems

Håkan Sundell, Chalmers University of Technology 10 Algorithm Constructing an Atomic Buffer N-readers and N-writers Constraints, non-uniform memory Constructing of simple components - register that can be written by processor i and read by processor j

Håkan Sundell, Chalmers University of Technology 11 Algorithm Wait-Free Atomic Shared Buffer by Vitanyi et. al A Matrix of 1-reader 1-writer registers... R 21 R 22 … R 11 R Readers Writers R ij - written by i read by j

Håkan Sundell, Chalmers University of Technology 12 Algorithm One reader/writer task on each processor Each registers contains a value/tag pair encoded as one value Readers scans its column for highest tag and returns the corresponding value Writers scan its column and writes the next tag together with the new value to its row

Håkan Sundell, Chalmers University of Technology 13 Algorithm The tag increases with each write operation Unbounded maximum size for the tag field in the value/tag pair Assume 8 writer tasks with 10 ms period –Maximum tag after one hour is which needs 22 bits! Memory size is very important, 8 bit computers are still most common

Håkan Sundell, Chalmers University of Technology 14 Bounding Recycling of the tags is necessary Timing information is available in real-time systems (J. Chen, A. Burns) Analysing the maximum difference between tags possible observable by a task at two consecutive invocations of the algorithm Using notations from the standard response time analysis for periodic fixed priority scheduling

Håkan Sundell, Chalmers University of Technology 15 Bounding In any possible execution: Where –T max is the longest period –R max is the longest response time –T wr is the period of the writer tasks

Håkan Sundell, Chalmers University of Technology 16 Bounding Analyse how to recycle the tags Newer tags can restart from zero when we reach a certain tag value In order to be able to decide if newer tags are newer we need to have:

Håkan Sundell, Chalmers University of Technology 17 Examples Example Task Scenario on 8 processors TaskPeriodTaskPeriod Wr11000Rd1500 Wr2900Rd2450 Wr3800Rd3400 Wr4700Rd4350 Wr5600Rd5300 Wr6500Rd6250 Wr7400Rd7200 Wr8300Rd8150

Håkan Sundell, Chalmers University of Technology 18 Examples T max = R max = 1000 MaxTagDiff = 38 TagFieldSize = 76 TagFieldBits = 7 Unbounded algorithm would have reached tag in one hour, needing >16 bits

Håkan Sundell, Chalmers University of Technology 19 Conclusions We have presented an atomic n-reader n- writer shared buffer. Usage of timing information enables us to recycle the tags and thus bound the memory usage The modified algorithm has small space requirements

Håkan Sundell, Chalmers University of Technology 20 Future work Investigations of other wait-free synchronization methods Implementations in RTOS kernels