Week 5 Reflection: Concurrency and Threads
This week we learned four main topics: concurrency, the thread API, locks, and lock based data structures. Concurrency is the idea that many tasks can appear to run at the same time, even if the system is really switching between them. The thread API teaches how to create threads, join them, and manage their behavior in a program. Locks are used to protect shared data so that only one thread can access a critical section at a time. Lock based data structures include locks in their operations to make them safe when multiple threads want to use them.
Explaining these topics helped me think about what I understand. Concurrency made sense because I can imagine how tasks might overlap and cause unexpected results. The thread API also felt clear because it is similar to programming tasks I have done before. Locks also made sense to me, since their purpose is to prevent threads from interfering with each other.
The hardest part of this week was not the lecture material but the midterm. I was very nervous while preparing for it and even more nervous during the test. I understood the readings and assignments, but the pressure of the midterm made me doubt myself. Because of this, it was harder to focus on the questions, even though I had studied. This experience showed me that I need to work on staying calm during exams so I can show what I really know.
My “aha” moment this week was when I learned about race conditions. Seeing how two threads can change the same value in different orders helped me understand why locks are necessary. This example connected all the topics together in a clear way.
I still wonder how real operating systems manage many threads at once without slowing down or causing errors. I think future lessons will explain more about scheduling and how the OS decides which thread should run at which time.
Overall, this week helped me understand concurrency better and also made me aware of how the midterm affected my confidence.
Comments
Post a Comment