cst 334: week 5
This week in CST 334, I learned about concurrency and how threads work in an OS. I started by reading about the basics of threads in chapter 26, which are smaller tasks within a process that can run at the same time. Using threads helps make better use of system resources, allowing multiple operations to happen concurrently. Then, I read about the Thread API, which gives the necessary functions to create and manage threads, like starting them, making sure they finish, and synchronizing them when needed.
I then studied locks, which are used to control access to shared resources between threads. Without locks, multiple threads could try to access the same resource at once, causing issues like data corruption. Locks ensure that only one thread can access a resource at a time, preventing conflicts. I also learned about locked data structures, which are built to handle multiple threads accessing them without breaking the data. These structures make sure data stays consistent, even with concurrent accesses.
To end, I covered condition variables which help synchronize threads. A condition variable allows one thread to wait for another to meet a certain condition before continuing. This is useful when one thread depends on another to complete a task before proceeding. Overall, to conclude, this week helped me understand how threads, locks, and condition variables work together to manage concurrency. These concepts seem to be very essential to making sure threads run smoothly and efficiently without interfering with each other, leading to more reliable systems. I'll definetly spend some more time reading over these this week, and the following week.
Comments
Post a Comment