LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9,...
-
Upload
marquis-parkinson -
Category
Documents
-
view
217 -
download
1
Transcript of LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9,...
![Page 1: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/1.jpg)
LUI SHA ,RAGUNATHAN RAJKUMAR ,JOHN P.LEHOCZKYIEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9,
SEPTEMBER 1990Repesent : Shu Wei Ho
![Page 2: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/2.jpg)
Motivation Simple solution Basic priority inheritance protocol(BIP) Deadlock Chain blocking Priority ceiling protocol(PCP) Conclusion
![Page 3: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/3.jpg)
Data Synchronization
Ex.
![Page 4: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/4.jpg)
Critical section(nonpreempt)
Ex.
![Page 5: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/5.jpg)
Chain blocking
PCP
t0 : J0 -> X J1 -> X J2 -> P2 (exe)
t1 : J0 -> X J1 -> P1 (exe) J2 -> P2
ta : J0 -> X J1 -> P1 (exe) J2 -> P2
t2 : J0 -> P0 (exe) J1 -> P1 J2 -> P2
t3 : J0 -> blocked by J2(S1) J1 -> P1 J2 -> P2 -> inherit -> P0 (exe)
t4 : J0 -> P0 (exe) J1 -> P1 J2 -> P0 -> P2
t5 : J0 -> blocked by J1(S2) J1 -> P1-> inherit -> P0 (exe) J2 -> P2
t6 : J0 -> P0 (exe) J1 -> P0 -> P1 J2 -> P2
t7 : J0 -> X J1 -> P1 (exe) J2 -> P2
t8 : J0 -> X J1 -> X J2 -> P2 (exe)
..
![Page 6: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/6.jpg)
PCP
'Thread 1 SyncLock LeftVal SyncLock RightVal 'Perform operations on LeftVal and RightVal that require read and write. End SyncLock End SyncLock
'Thread 2 SyncLock RightVal SyncLock LeftVal 'Perform operations on RightVal and LeftVal that require read and write. End SyncLock
End SyncLock
![Page 7: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/7.jpg)
Set priority to each critical section
Use S0-> J0(H)-> priority of S0 = P0(J0) S1-> J2 J1(H)-> priority of S1= P1(J1) S2-> J2 J1(H)-> priority of S2= P1(J1)
![Page 8: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/8.jpg)
Terminology◦ Task priority ( Jn -> Pn)◦ Resource Ceiling /System Ceiling (SC)◦ Inheritance Priority
Protocol◦ Priority driven scheduling◦ Lock/Unlock◦ Block/Unblock
![Page 9: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/9.jpg)
t0 : J0 -> X J1 -> X J2 -> P2 (exe) SC -> Lowest
ta : J0 -> X J1 -> X J2 -> P2(attempt to lock S2)>SC (Lowest)(exe) SC -> Lowest->(P1, J2(S2))
t1 : J0 -> X J1 -> P1 (preempt) (exe) J2 -> P2 SC -> (P1, J2(S2))
t2 : J0 -> X J1 -> P1 (attempt to lock S2)≯SC(P1) J2 -> P2->inherit->P1 (exe) SC ->(P1, J2(S2))
t3 : J0 -> X J1 -> P1 J2 ->(attempt to lock S1)P1≯SC(P1) but self (exe) SC -> (P1, J2(S2))
t4 : J0 -> P0(preempt) (exe) J1 -> P1 J2 -> P1 SC -> (P0, J2(S1))
t5 : J0 -> (attempt to lock S0) P0≯SC(P0) J1 -> P1 J2 -> P1->inherit J0 -> P0 (exe) SC -> (P0, J2(S1))
t6 : J0 -> (attempt to lock S0) P0>SC(P1) (exe) J1 -> P1 J2 -> P1 SC -> (P0, J2(S1))->(P1, J2(S2))->(P0, J0(S0))
tb : J0 -> (attempt to lock S1) P0 >SC(P1) (exe) J1 -> P1 J2 -> P1 SC -> (P1, J2(S2))->(P0, J1(S1))
t7 : J0 -> end J1 -> P1( attempt to lock S2)≯SC(P1) J2 -> P1 (exe) SC -> (P1, J2(S2))
t8 : J0 -> end J1 -> P1(attempt to lock S2)>SC(lowest) (exe) J2 -> P2 SC -> (P1, J2(S2))->Lowest -> (P1, J1(S2))
t9 : J0 -> end J1 -> end J2 -> P2 (exe) SC -> Lowest
Priority of S0 = P0 S1 = P1 S2 = P1
..
![Page 10: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/10.jpg)
Deal with deadlock
BIP
![Page 11: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/11.jpg)
Deal with chain blocking
BIP
ta : J0 -> X J1 -> (attempt to lock S2)P1< SC(P0) J2 -> J2 -> inherit -> P1 (exe) SC -> (P0, J2(S1))
![Page 12: LUI SHA,RAGUNATHAN RAJKUMAR,JOHN P.LEHOCZKY IEEE TRANSACTIONS ON COMPUTERS, VOL. 39, NO. 9, SEPTEMBER 1990 Repesent : Shu Wei Ho.](https://reader030.fdocuments.us/reader030/viewer/2022032701/56649c785503460f9492d8b2/html5/thumbnails/12.jpg)
It showed that both protocols solve the uncontrolled priority inversion problem.
In particular, the priority ceiling protocol prevents deadlocks and reduces the
blocking to at most one critical section.