5.5.14 · D3 · HinglishEmbedded Systems & Real-Time Software

Worked examplesPriority inversion — problem and solutions (priority inheritance, priority ceiling)

4,415 words20 min read↑ Read in English

5.5.14 · D3 · Coding › Embedded Systems & Real-Time Software › Priority inversion — problem and solutions (priority inherit


Scenario matrix

Is topic ki har case in cells mein se kisi ek mein aati hai. Neeche har worked example us cell ke saath tagged hai jise woh cover karta hai.

# Case class Kya vary karta hai Example
C1 Bounded inversion (baseline) H sirf L ke CS ka intezaar karta hai Ex 1
C2 Unbounded inversion (bug) M ghus jaata hai, koi protocol nahi Ex 2
C3 PIP fix — single lock boosting M ko hata deta hai Ex 3
C4 PIP limit — chained/nested locks blocking sum hoti hai Ex 4
C5 PCP — nested locks, ek baar blocked ceiling gate Ex 5
C6 Deadlock case: PIP allow karta hai, PCP forbid karta hai do locks, opposite order Ex 6
C7 Degenerate: sirf 2 priority levels / koi shared lock nahi koi inversion possible nahi Ex 7
C8 Limiting value: CS length → 0 aur M runtime → ∞ bound kahan hai Ex 8
C9 Real-world word problem (Mars Pathfinder numbers) ek story pe apply karo Ex 9
C10 Exam twist: ICPP timing — shuru hone se pehle block hona immediate ceiling Ex 10

Hum har cell mein (H ki blocking) compute karte hain. Har worked example jisme time-geometry hai (ek schedule on a clock) uska apna timeline figure hai, taaki tum blocking dekh sako, sirf number padho nahi.


Ex 1 — C1: Bounded inversion (acceptable baseline)

Figure — Priority inversion — problem and solutions (priority inheritance, priority ceiling)

Ex 2 — C2: Unbounded inversion (koi protocol nahi, the bug)

Figure — Priority inversion — problem and solutions (priority inheritance, priority ceiling)

Ex 3 — C3: PIP single-lock case fix karta hai

Figure — Priority inversion — problem and solutions (priority inheritance, priority ceiling)

Ex 4 — C4: PIP ki limit — chained (nested) blocking sum up hoti hai

Figure — Priority inversion — problem and solutions (priority inheritance, priority ceiling)

Ex 5 — C5: PCP — nested locks, zyada se zyada ek baar blocked

Figure — Priority inversion — problem and solutions (priority inheritance, priority ceiling)

Ex 6 — C6: Deadlock case — PIP allow karta hai, PCP forbid karta hai

Figure — Priority inversion — problem and solutions (priority inheritance, priority ceiling)

Ex 7 — C7: Degenerate inputs — jab inversion impossible hai

Figure — Priority inversion — problem and solutions (priority inheritance, priority ceiling)

Ex 8 — C8: Limiting values — bound asal mein kahan rehta hai

Figure — Priority inversion — problem and solutions (priority inheritance, priority ceiling)

Ex 9 — C9: Real-world word problem (Mars Pathfinder, numbers ke saath)

Figure — Priority inversion — problem and solutions (priority inheritance, priority ceiling)

Ex 10 — C10: Exam twist — ICPP tumhe shuru hone se pehle block karta hai

Figure — Priority inversion — problem and solutions (priority inheritance, priority ceiling)

Recall

Recall Matrix par khud ko test karo

Kaun sa cell? Har ek ke liye, answer batao.

  • Do tasks, ek lock, koi M nahi — bounded ya unbounded? ::: Bounded, (C1)
  • Woh kaun sa single term hai jo Ex 2 ko unbounded banata hai? ::: M ka runtime , lock se unrelated (C2)
  • PIP on Ex 2: kya hai? ::: ms — sirf L ka critical section (C3)
  • PIP vs PCP ke under nested locks: sum ya max? ::: PIP CSs sum karta hai; PCP max leta hai (C4/C5)
  • Kaun sa protocol deadlock prevent karta hai? ::: PCP (acyclic ceiling ordering); PIP nahi karta (C6)
  • Critical section ko near-zero tak shrink karna — kya yeh unbounded inversion fix karta hai? ::: Nahi; khatara blocking window hai, CS size nahi (C8)
  • ICPP: ek task kab block ho sakta hai? ::: Sirf shuru hone se pehle, kabhi baad mein nahi (C10)

Yeh bhi dekho: Real-Time Scheduling — Rate Monotonic & EDF, RTOS task states and context switching, Worst-Case Execution Time (WCET) analysis.