CST 334 - Week 5
Week 5 Overview:
This week in CST 334, I learned a lot about locks and concurrency. The most interesting part was understanding how different types of locks work especially spin locks vs ticket locks. At first, I thought all locks were the same, but now I see how much design actually matters. Spin locks are simple but waste CPU cycles under high contention. Ticket locks are smarter. They use a “take-a-number” approach, which makes things more fair and avoids starvation. We also learned about hardware instructions like test-and-set and compare-and-swap. These are used to build locks at a lower level. It really showed me how messy things can get when threads share data without proper coordination. Even a small race condition can lead to unpredictable bugs.
We also had the midterm this week, which was honestly rough. The one-hour time limit was tight, and it felt super rushed, especially since we’ve had unlimited time on quizzes before. Some of the questions were a lot harder than expected and didn’t really match the quiz style. I had to rely heavily on my notes, especially for the math-based scheduling problems. A lot of us felt thrown off by the Round Robin stuff too, since the lab quizzes had confusing or incorrect answers. I did like that the exam was ordered by point value, which helped with pacing a bit, but overall it felt stressful even after preparing. This week definitely reminded me how important time management and deeper understanding of the material really are.
Comments
Post a Comment