CST334 - Week 6 Reflection
Weekly Learning Reflection The core focus this week was firmly rooted in safely managing access to shared resources using synchronization primitives like mutex locks, semaphores, and condition variables. I learned that mutexes are essential for protecting critical sections, ensuring that only one thread can access shared data at a time. We extended this idea by using condition variables (pthread_cond_t) to block threads until specific conditions are met, a powerful tool for coordinating complex thread interactions. I applied this in the big readers-writers assignment this week, where multiple threads may read from a shared database concurrently, but writes must happen exclusively. Implementing this pattern required carefully checking conditions, signaling waiting threads, and managing a maximum number of concurrent readers to avoid race conditions or deadlocks. I loved how well the lecture and reading matched up with the programming assignment...