CST334 Week 5
This week I focused on concurrency and how it allows processes to run multiple threads in parallel, allowing tasks to be handled in the background while the main application continues. While I’ve previously worked with multithreading in Java, learning how the operating system manages concurrency gave me a better understanding of how multithreading works in the CPU. I learned that threads can share certain resources, such as virtual address space which makes communication between them efficient, but also introduces its own challenges. One of the key concepts I learned was nondeterminism in multithreaded programs. Even if two threads call the same function, the order in which memory is accessed and modified can change which can lead to different outcomes every time the program runs. This unpredictability can cause bugs that are hard to reproduce and debug. To address this, we use thread synchronization APIs like locks, or mutexes...