5th week CST 334
This week's material is mostly about concurrency, most notably threads and locks. Most of the material is new to me except the race condition since I am studying cybersecurity. In threads it is like a process except multiple of them can be stored inside of a process sharing the virtual address space which makes the process be able to perform multiple execution in the program. However, each thread has its own stack and registers and one of its downsides is that if one thread blocks then the entire process blocks. The two main reasons the thread is beneficial are parallelization which speeds up the process that turns single threaded program into a program that performs the tasks like it has multiple CPUs. The other reson is to avoid program progress from getting blocked which is caused by slow I/O. The main idea behind lock or also known as mutex (mutual exclusion) is to prevent race condition where 2 or more threads from reading or writing shared data in the shard re...