We covered topics about concurrency, threads, and how to use locks and condition variables to manage shared resources safely. These are interesting topics to learn how a single program can actually have multiple threads running at once, and each thread can do a different task. This helps the program run faster and use the CPU more efficiently, especially on multi-core systems.
One of the important topics that I learned is that shared memory between threads can lead to problems like race conditions. For example, when two threads try to change a variable at the same time, the result might be wrong. To solve this, we can use locks to make sure only one thread can access the critical section at a time. I also learned about condition variables, which are useful when one thread needs to wait for another to finish something. These tools help keep threads in order so they don’t mess up shared data.
I still need more time to go over this week's topics since we had a mid-term exam. I spent most of the time preparing for the exam at the beginning of this week and didn't have enough time to study for this week's topics. I'll go over the reading and slides to better understand for those topics.
No comments:
Post a Comment