Using timing information on wait free algorithms in real time systems 2 papers
Download
1 / 30

Using Timing Information on Wait-Free Algorithms in Real-Time Systems (2 papers) - PowerPoint PPT Presentation


  • 109 Views
  • Uploaded on

Using Timing Information on Wait-Free Algorithms in Real-Time Systems (2 papers). Håkan Sundell Philippas Tsigas Yi Zhang Computing Science Chalmers University of Technology. Real-Time System Synchronization Algorithms (Snapshot + Buffer) Bounding Experiments Conclusions Future work.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Using Timing Information on Wait-Free Algorithms in Real-Time Systems (2 papers)' - halee-rocha


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Using timing information on wait free algorithms in real time systems 2 papers

Using Timing Information on Wait-Free Algorithms in Real-Time Systems (2 papers)

Håkan Sundell

Philippas Tsigas

Yi Zhang

Computing Science

Chalmers University of Technology


Schedule

Real-Time System Real-Time Systems (2 papers)

Synchronization

Algorithms (Snapshot + Buffer)

Bounding

Experiments

Conclusions

Future work

Schedule


Real time system

Multiprocessor system Real-Time Systems (2 papers)

Interconnection Network

Shared memory (with or without constraints)

Real-Time System

CPU

CPU

CPU

CPU


Real time system1

Cooperating Tasks Real-Time Systems (2 papers)

Timing constraints

Need synchronization

Shared Data Objects

In this presentation: Atomic Snapshot and Atomic Buffer

Real-Time System


Synchronization

Synchronization methods Real-Time Systems (2 papers)

Lock

Uses semaphores, spinning, disabling interrupts

Negative

Blocking

Priority inversion

Risk of deadlock

Positive

Execution time guarantees easy to do

Synchronization

Take lock

... do operation ...

Release lock


Synchronization1

Synchronization methods Real-Time Systems (2 papers)

Lock-free

Retries until not interfered by other operations

Usually uses some kind of shared flag variable

Synchronization

Write flag with unique value

... do operation ...

Check flag value and maybe retry


Synchronization2

Synchronization methods Real-Time Systems (2 papers)

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

Synchronization


Synchronization3

Synchronization methods Real-Time Systems (2 papers)

Wait-free

Uses atomic synchronization primitives

Uses shared memory

Negative

Complex algorithms

Memory consuming

Synchronization

Test&Set

Compare

&Swap

Copying

Helping

Announcing

Split

operation

???


Synchronization4

Synchronization methods Real-Time Systems (2 papers)

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

Synchronization


Snapshot

Snapshot Real-Time Systems (2 papers)

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

Snapshot


Algorithm

Wait-Free Snapshot Algorithm Real-Time Systems (2 papers)

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

Algorithm


Algorithm1

Unbounded Snapshot Protocol Real-Time Systems (2 papers)

Algorithm

Snapshotindex

? = previous values / nil

w = writer position

c1

v

?

?

?

?

w

nil

nil

ci

v

?

?

?

?

w

nil

nil

cc

v

?

?

?

?

w

nil

nil

t


Algorithm buffer

Constructing an Atomic Buffer Real-Time Systems (2 papers)

N-readers and N-writers

Constraints , non-uniform memory

Constructing of simple components

Algorithm (Buffer)

  • register that can be written by processor i

  • and read by processor j


Algorithm2

Wait-Free Atomic Shared Buffer by Vitanyi et. al Real-Time Systems (2 papers)

A Matrix of 1-reader 1-writer registers

Algorithm

Readers

R11

R12

...

R21

R22

...

...

...

Rij

  • written by i

  • read by j

Writers


Algorithm3

The tag increases with each write operation Real-Time Systems (2 papers)

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 2880000 which needs 22 bits!

Memory size is very important, 8 bit computers are still most common

Algorithm


Bounding

Assuming system with periodic fixed-priority scheduling Real-Time Systems (2 papers)

Notations from Standard Real-Time Response Time Analysis

Use information about

Periods , T

Computation time , C

Response times , R

Bounding


Bounding snapshot

We must recycle the array indexes in some way Real-Time Systems (2 papers)

Keep track of the scanner versus the updaters positions

Previous solution by Ermedahl et. al

Synchronized using atomic Test and Set operations

Bounding (Snapshot)


Bounding1

Needed buffer length for component k Real-Time Systems (2 papers)

Can be refined even further

Bounding

where Ts is the period for the snapshot task

Tw is the period for the writer tasks


Bounding buffer

Recycling of the tags is necessary Real-Time Systems (2 papers)

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

Bounding (Buffer)


Bounding2

In any possible execution: Real-Time Systems (2 papers)

Where

Tmax is the longest period

Rmax is the longest response time

Twr is the period of the writer tasks

Bounding


Bounding3

Analyse how to recycle the tags Real-Time Systems (2 papers)

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:

Bounding


Experiments

Using a Sun Enterprise 10000 multiprocessor computer Real-Time Systems (2 papers)

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

Experiments


Experiments1

7 different scenarios Real-Time Systems (2 papers)

Experiments


Experiments2

Scan operation - Average Response Time Real-Time Systems (2 papers)

Experiments


Experiments3

Update operation – Average Response Time Real-Time Systems (2 papers)

Experiments


Examples buffer

Example Task Scenario on 8 processors Real-Time Systems (2 papers)

Examples (Buffer)


Examples

T Real-Time Systems (2 papers)max = Rmax = 1000

MaxTagDiff = 38

TagFieldSize = 76

TagFieldBits = 7

Unbounded algorithm would have reached tag 68400 in one hour , needing >16 bits

Examples


Conclusions snapshot

Update operation Real-Time Systems (2 papers)

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

Conclusions (Snapshot)


Conclusions buffer

We have presented an atomic n-reader n-writer shared buffer. Real-Time Systems (2 papers)

Usage of timing information enables us to recycle the tags and thus bound the memory usage

The modified algorithm has small space requirements

Conclusions (Buffer)


Future work

Investigations of other wait-free synchronization methods Real-Time Systems (2 papers)

Implementations in RTOS kernels

Future work


ad