Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Simple Wait-Free Snapshots for Real-Time Systems with Sporadic Tasks Håkan Sundell Philippas Tsigas."— Presentation transcript:

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

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

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

4 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 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 6 Blocking Synchronization Drawbacks Blocking Priority Inversion Risk of deadlock Locks: Semaphores, spinning, disabling interrupts etc. Reduced efficiency because of reduced parallelism

7 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 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 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 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 11 Linearizability for Snapshots Atomicity / Linearizability criteria t Write Read cici t Write Read cici NO = returned by scanner

12 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 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 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 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 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 17 Experiments Using a Sun Enterprise 10000 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 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 19 Experiments 7 different scenarios ScenarioScan Period (  s) Update Period (  s) Buffer Length 1500503 2200503 3100503 4 4 5 1006 65020010 75050022

20 20 Experiments

21 21 Experiments

22 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 23 Questions? Contact Information: Address: Håkan Sundell vs. Philippas Tsigas Computing Science Chalmers University of Technology Email: @ cs.chalmers.se Web: http://www.cs.chalmers.se/~phs/warp


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

Similar presentations


Ads by Google