Simple and Fast WaitFree Snapshots for RealTime Systems - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Simple and Fast WaitFree Snapshots for RealTime Systems

Description:

If all of those criteria are fulfilled then our snapshot algorithm are linearizable ... gives up to 20 % better performance in common practical scenarios ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 30
Provided by: perhkan
Category:

less

Transcript and Presenter's Notes

Title: Simple and Fast WaitFree Snapshots for RealTime Systems


1
Simple and Fast Wait-Free Snapshots for Real-Time
Systems
  • Håkan Sundell
  • Philippas Tsigas
  • Yi Zhang
  • Computing Science
  • Chalmers University of Technology

2
Schedule
  • Real-Time System
  • Synchronization
  • Algorithm
  • Bounding
  • Experiments
  • Conclusions
  • Future work

3
Real-Time System
  • Multiprocessor system
  • Interconnection Network
  • Shared memory


CPU
CPU
CPU
CPU
4
Real-Time System
  • Cooperating Tasks
  • Timing constraints
  • Need synchronization
  • Shared Data Objects
  • In this paper Atomic Snapshot

5
Synchronization
  • Synchronization methods
  • Lock
  • Uses semaphores, spinning, disabling interrupts
  • Negative
  • Blocking
  • Priority inversion
  • Risk of deadlock
  • Positive
  • Execution time guarantees easy to do

Take lock ... do operation ... Release lock
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
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

8
Synchronization
  • Synchronization methods
  • Wait-free
  • Uses atomic synchronization primitives
  • Uses shared memory
  • Negative
  • Complex algorithms
  • Memory consuming

TestSet Compare Swap Copying Helping Announcing
Split operation ???
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

10
Snapshot
  • Shared variables
  • Read / Write registers
  • Some values are related together

11
Snapshot
  • Snapshot
  • A consistent momentous state of a set of several
    shared variables
  • One reader
  • Reads the whole set of variables in one atomic
    step
  • Many writers
  • Writes to only one variable each time

12
Linearizability
  • Atomicity / Linearizability criteria

ci
Write
Write
NO
Write
cj
t
Read
YES
ci
t
Write
Write
Read
YES
ci
t
Write
Write
returned by scanner
13
Linearizability
  • Atomicity / Linearizability criteria

Read
NO
ci
t
Write
Write
Read
NO
ci
t
Write
Write
returned by scanner
14
Linearizability
  • If all of those criteria are fulfilled then our
    snapshot algorithm are linearizable
  • All operations can be transformed into a serial
    sequence of atomic operations

15
Algorithm
  • Wait-Free Snapshot Algorithm
  • Unbounded memory
  • Each component represented by an infinite
    nil-value-initialized array, higher index for
    more recent values
  • A global index register where all component
    writers writes the updated value
  • The reader scans all component arrays backwards
    from current position

16
Algorithm
  • Unbounded Snapshot Protocol

Snapshotindex
? previous values / nil w writer position
v
?
?
?
?
w
nil
nil
c1
ci
v
?
?
?
?
w
nil
nil
cc
v
?
?
?
?
w
nil
nil
t
17
Bounding
  • We must recycle the array indexes in some way
  • Keep track of the scanner versus the updaters
    positions
  • Previous solution by Ermedahl et. al
  • Synchronized using atomic Test and Set operations

18
Bounding
int TestAndSet(int p) atomic if(!p)
p1return 1 else return 0
  • Solution in real-time systems
  • Using timing information!

19
Bounding
  • Assuming system with periodic fixed-priority
    scheduling
  • Notations from Standard Real-Time Response Time
    Analysis
  • Use information about
  • Periods , T
  • Computation time , C
  • Response times , R

20
Bounding
  • Use cyclical buffers
  • Keep track that updater position is always behind
    the scanner so that new positions are always free

21
Bounding
  • Needed buffer length is dependent on how fast the
    updaters is compared to the scanner
  • Each component can have different buffer lengths

22
Bounding
  • Needed buffer length for component k
  • Can be refined even further

where Ts is the period for the snapshot task Tw
is the period for the writer tasks
23
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

24
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

25
Experiments
  • 7 different scenarios

26
Experiments
  • Scan operation - Average Response Time

27
Experiments
  • Update operation Average Response Time

28
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

29
Future work
  • Investigations of other wait-free synchronization
    methods
  • Implementations in RTOS kernels
Write a Comment
User Comments (0)
About PowerShow.com