↑ Real Time Systems: Notes

Class Meeting #19: Review for Exam, Threads

 

Topics for Today


Topics Covered on Midterm Examination

  1. No excuse for missing anything on the prior quizzes!
  2. No excuse either for missing anything on the prior midterms exams:
  3. Do not assume the exam this term will be so similar to these two as they were to one another!
  4. See next slide for an independent list of topics

More Topics to Study for Midterm Examination


An OO Thread-based Design for Gizmo Controller

Set priorities according to rate monotonic model

Main issue now becomes how to safely share state


Safe Sharing of Data between Threads

  1. Single writer solutions, using volatile atomic variables
  2. Protection with mutexes

See examples via links below for details on both.


Signaling Events between Threads

  1. Use condition variables
  2. Always use pthread_cond_wait in a loop with a state variable test
  3. Allow for spurious and multiple wake-ups
  4. Protect the state variable with a mutex

Notes and Examples of Thread Programming

Including correct usage of condition variables and mutexes


Things for You to Do

© 2006 T. P. Baker ($Id: wk10t.html,v 1.1 2008/08/25 11:18:48 baker Exp $)