Deadlocks and Starvation
Lecture 23 of CS604 Operating Systems explores advanced semaphore implementations and concurrency hazards. To overcome the severe CPU inefficiency of busy-waiting spinlocks, the lecture presents semaphore implementations with waiting queues. A semaphore is defined as a C structure containing an integer value and a linked list of waiting process control blocks. When a process executes wait() and finds the semaphore value non-positive, it invokes the block() system call to suspend itself and move to the semaphore's waiting queue. When another process executes signal(), it invokes wakeup() to restart a blocked process and place it back on the ready queue. The lecture analyzes severe synchronization hazards, including deadlocks arising from inverted semaphore acquisition sequences and starvation. The Priority Inversion problem is investigated, illustrating how a lower-priority process holding a shared lock indirectly blocks a higher-priority process, alongside its industrial solution: the Priority Inheritance Protocol. Secondary storage management principles are illustrated through disk arm scheduling algorithms including SSTF, SCAN, and C-LOOK. By engaging with solved past papers by Moaaz and Waqar Siddhu, learners gain actionable insights into recurrent university exam questions. Interactive quiz assessments on VU SIGMA facilitate rapid knowledge verification and retention of critical operating systems terminology. Comprehensive coverage of POSIX standards ensures learners communicate with technical precision across modern system programming domains. Detailed analysis of kernel synchronization primitives highlights the imperative of preventing race conditions in multi-threaded programs. Process scheduling mechanisms in UNIX System V are contrasted with modern Linux completely fair scheduling principles. Students evaluate the trade-offs between user-level and kernel-level thread models in multi-core processor environments. The lesson explores deadlocks by examining the four necessary Coffman conditions and proactive deadlock prevention protocols. Practical code illustrations demonstrate process creation via fork, execution overlay via exec, and process synchronization via wait. Hardware protection rings and dual-mode CPU operation are investigated to show how operating systems safeguard memory and privileged instructions. Scholars analyze disk sector allocation schemes including contiguous, linked, and indexed methods to evaluate file access performance.
No questions available yet.
There are currently no examination questions published for Deadlocks and Starvation. Explore other curriculum units or build a custom quiz with the practice builder.