This week in CST334, I got a hands-on understanding of semaphores and how they help manage synchronization in multithreaded programs. In Lab 6 I worked on the producer-consumer problem which showed how semaphores like sem_wait and sem_post can control access to shared resources. It was a great way to see how these simple tools prevent issues like race conditions or buffer overflow by ensuring only one thread accesses the critical section at a time. Running the threadSync.c program really showed how unpredictable thread behavior can be without proper synchronization. This lab was helpful in explaining the concept of semaphores for me and it was satisfying to see my code work exactly as originally intended.
This week I focused a lot on understanding time complexity and recursive analysis. It was challenging at first to figure out how to break down recursive functions and write the correct recurrence relations. Applying the Master Theorem was especially tough because I had to carefully identify each part of the formula and decide which case applied. I also spent time reviewing the difference between Big O, Big Omega, and Big Theta, which helped me better understand how to describe the efficiency of an algorithm. These concepts took time to click but working through examples really helped.
Comments
Post a Comment