1 / 29

Simple and Fast Wait-Free Snapshots for Real-Time Systems

Simple and Fast Wait-Free Snapshots for Real-Time Systems. Håkan Sundell Philippas Tsigas Yi Zhang Computing Science Chalmers University of Technology. Real-Time System Synchronization Algorithm Bounding Experiments Conclusions Future work. Schedule. Multiprocessor system

basil-fry
Download Presentation

Simple and Fast Wait-Free Snapshots for Real-Time Systems

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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. Real-Time System Synchronization Algorithm Bounding Experiments Conclusions Future work Schedule

  3. Multiprocessor system Interconnection Network Shared memory Real-Time System CPU CPU CPU CPU

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

  5. Synchronization methods 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

  6. Synchronization methods 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

  7. 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 Synchronization

  8. Synchronization methods Wait-free Uses atomic synchronization primitives Uses shared memory Negative Complex algorithms Memory consuming Synchronization Test&Set Compare &Swap Copying Helping Announcing Split operation ???

  9. 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 Synchronization

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

  11. 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 Snapshot

  12. Atomicity / Linearizability criteria Linearizability ci Write Write NO cj Write t Read YES ci Write Write t Read YES ci Write Write t = returned by scanner

  13. Atomicity / Linearizability criteria Linearizability Read NO ci Write Write t Read NO ci Write Write t = returned by scanner

  14. 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 ti Write tj Read tk Write ser t Linearizability

  15. 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 Algorithm

  16. Unbounded Snapshot Protocol Algorithm Snapshotindex ? = previous values / nil w = writer position c1 v ? ? ? ? w nil nil ci v ? ? ? ? w nil nil cc v ? ? ? ? w nil nil t

  17. 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 Bounding

  18. Solution in real-time systems Using timing information! Bounding int TestAndSet(int *p) atomic { if(!*p) {*p=1;return 1} else {return 0} }

  19. 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 Bounding

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

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

  22. Needed buffer length for component k Can be refined even further Bounding where Ts is the period for the snapshot task Tw is the period for the writer tasks

  23. 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 Experiments

  24. 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 Experiments

  25. 7 different scenarios Experiments

  26. Scan operation - Average Response Time Experiments

  27. Update operation – Average Response Time Experiments

  28. 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 Conclusions

  29. Investigations of other wait-free synchronization methods Implementations in RTOS kernels Future work

More Related