Week 5 - CST 334
This week we completed the midterm exam. I definitely feel like I needed to study more for it. Besides the midterm, we learned about concurrency and how it allows multiple parts of a program to run at the same time using threads. Threads are different from processes in that they share memory space, making them more difficult to manage. We also learned how to create and manage threads using pthreads. We also learned about locks and how they are used to prevent threads from interfering with each other. Specifically, mutexes, or mutual exclusions, are used so that only one thread can access code or data at a time. When a thread accesses data, it locks the mutex. Another thread may only access that same piece of data until it is unlocked by the first thread.