Week 30
This week's material deepened my understanding of concurrency control and how it can get out of control. Semaphores emerged as a synchronization tool, functioning as both locks and condition variables. Their atomic operations, sem_wait() and sem_post(), enable thread coordination, enforcing mutual exclusion in critical sections or guaranteeing execution order. Improper usage risks deadlocks, as seen in the dining philosophers problem, where circular wait conditions arise unless lock acquisition is carefully ordered. The readings from this week also highlighted non-deadlock concurrency bugs, which happen a lot in real-world systems. Atomicity violations, like a thread interrupted between checking and using a pointer-expose flawed assumptions about uninterrupted execution. Order violations, where threads rely on unchecked execution sequences, further underscore the need for synchronization primitives to enforce correctness. Deadlocks remain insidio...