Created
April 4, 2018 23:06
-
-
Save lambdageek/4188cae9ee8e8fe2ecff8700642e45e6 to your computer and use it in GitHub Desktop.
Blocking_and_Suspended back to Blocking?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Suppose victim is in BLOCKING and suspend count is 2. | |
Old technique | |
BLOCKING|susp=2 | |
abort_blocking() -> returns AbortBlockingWait | |
BLOCKING_AND_SUSPENDED|susp=2 | |
waits on resume semaphore | |
... (suspend initiator calls resume) | |
BLOCKING_AND_SUSPENDED|susp=1 | |
... (suspend initiator has nothing else to do) | |
// vicitim still waiting | |
... (suspend initiator calls resume again) | |
RUNNING | |
... (suspend initiator signals on resume semaphore) | |
// victim wakes up | |
New technique | |
BLOCKING|susp=2 | |
abort_blocking() -> returns AbortBlockingWaitAndRetry | |
BLOCKING_AND_SUSPENDED|susp=2 | |
waits on resume semaphore | |
... (suspend initiator calls resume) | |
BLOCKING|susp=1 | |
... (suspend initiator has nothing else to do) | |
// victim still waiting | |
... (suspend initiator calls resume again) | |
BLOCKING|susp=0 | |
... (suspend initiator posts on the semaphore) | |
//victim wakes up | |
goto top | |
abort_blocking () -> AbortBlockingOk | |
RUNNING | |
Suppose victim is in BLOCKING and suspend count is 1. | |
Old technique | |
BLOCKING|susp=1 | |
abort_blocking() -> return AbortBlockingWait | |
BLOCKING_AND_SUSPENDED|susp=1 | |
waits on resume semaphore | |
... (suspend initiator calls resume) | |
RUNNING | |
// victim wakes up | |
New technique | |
BLOCKING|susp=1 | |
abort_blocking() -> return AbortBlockingWaitAndRetry | |
BLOCKING_AND_SUSPENDED|susp=1 | |
wait on resume semaphore | |
... (suspend initiator calls resume) | |
BLOCKING|susp=0 | |
... (suspend initiator posts on the semaphore) | |
// victim wakes up | |
goto top | |
abort_blocking () -> AbortBlockingOk | |
RUNNING |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment