1 / 162

Priority Inversion

Priority Inversion. Roadmap for Today. Priority Inversion Resource protocols Synchronization Mechanisms Signaling Semaphores Monitors Synchronization Problems Producer / Consumer and Reader / Writer. Example. 5 processes process number equals priority Priority of P5 > priority of P1

lot
Download Presentation

Priority Inversion

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. Priority Inversion

  2. Roadmap for Today • Priority Inversion • Resource protocols • Synchronization Mechanisms • Signaling • Semaphores • Monitors • Synchronization Problems • Producer / Consumer and • Reader / Writer

  3. Example • 5 processes • process number equals priority • Priority of P5 > priority of P1 • Release and execution times as shown • No deadlines (only an example for later comparison) • Priority-driven preemptively scheduled P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  4. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  5. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  6. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  7. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  8. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  9. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  10. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  11. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  12. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  13. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  14. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  15. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  16. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  17. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  18. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  19. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  20. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  21. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  22. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  23. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  24. Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  25. Reality is more complex • Processes are not usually independent

  26. Real-Time Traffic Scheduling • Two process streams • A high priority & a low priority

  27. Problem • Intersection is a mutually exclusive resource

  28. Mutual Exclusion • Can be solved by resource access protocols

  29. Priorities and Resource Contention Main Reference Pane W. S. Liu “Real-time Systems”, Chapter 8

  30. Resources • Processes require resources in order to execute. (e.g. locks, ports, memory, …) • Resource characteristics • Serially reusable, • Mutually exclusive • We ignore resources that • are infinitely available or exceed demand, • or can be pre-allocated.

  31. P3 3 P2 2 R1 P1 1 Resource Contention Problem • Priority inversion. • We need to, at least, bound the length of priority inversion. • Preferably minimize the length of priority inversion. Famous example of priority inversion: Mars Pathfinder 1997

  32. Marth Pathfinder Mars Path Finder and the famous Mars Rock YOGI

  33. Resource Contention Problems • Timing anomaly • Deadlock P2 2 R1 R2 P1 1

  34. Resource Contention Major Assumption • Single processor system

  35. Nested Critical Section* *P2 first needs R1 and then later additionally R2 Example with Resources Our Example + 2 Resources Resource 1 P5 Resource 2 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  36. SPD Scheduling Simple Priority Driven Scheduling P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  37. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  38. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  39. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  40. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  41. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  42. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  43. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  44. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  45. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  46. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  47. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  48. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  49. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

  50. SPD Scheduling Example P5 P4 P3 P2 P1 0 2 4 6 8 10 12 14 16 18 20

More Related