Based on Chapter 4 of [Hai19]
(Usage hints for this presentation)
Computer Structures and Operating Systems 2021
Dr. Jens Lechtenbörger (License Information)
(Short answer: No. Issues such as priority inversion, deadlocks, starvation may arise.)
Robotic spacecraft named Pathfinder
High-priority thread: “initially blocked; unblocked to handle event after 300 milliseconds” perform lock() on mutex run for 1 millisecond on CPU perform unlock() on mutex terminate execution of the whole program Medium-priority thread: “initially blocked; unblocked to handle event after 300 milliseconds” run for 800 milliseconds on CPU Low-priority thread: “initially runnable” perform lock() on mutex perform I/O operation which leads to blocking for 500 milliseconds run for 1 millisecond on CPU perform unlock() on mutex
Permanent blocking of thread set
yourAccountby thread 1; transfer in other direction by thread 2
myAccount, while thread 2 locks
Deadlock if and only if (1) – (4) hold [CES71]:
(Note: Choice of shapes is arbitrary; just for visualization purposes)
These strategies are covered in subsequent slides.
(Refresh HTML presentation for other drawings)
myAccounthas number 42,
myAccountfirst (as 42 < 4711)
lock()M repeatedly during its time slice
Starvation of P0
This document is part of an Open Educational Resource (OER) course on Operating Systems. Source code and source files are available on GitLab under free licenses.
In particular, trademark rights are not licensed under this license. Thus, rights concerning third party logos (e.g., on the title slide) and other (trade-) marks (e.g., “Creative Commons” itself) remain with their respective holders.