CST 334 Week 5 Learning Journal

This week in CST 334 we learned about Concurrency and Threads, Thread API, Locks and Locked Data Structures, Condition variables and synchronization. Threads share the same address spaces , where processes do not. So threads have much more efficient communication but also can lead to more problems like synchronization issues. Parts of code where shared resources are accessed are called critical sections. These sections ,ust be protected to make sure they are mutually exclusive and prevent threads from executing the sections simultaneously. One way to stop this from happening is Locks as they ensure only one thread is at a critical section. Another way is by condition variables which allow threads to wait for conditions before moving on to the next section. We also learned about indeterminate which is when an output is inconsistent and unpredictable no matter if the input is the same. Locks also help prevent this as well as atomic operations. Atomic operations are operations that make sure they finish to completion with no interuptions.  These atomic operations are important to maintain consistent data. 


We looked at hardware solutions like the test and set or compare and swap instructions. Both of these help give efficient lock implementations. We also learned about pipes which are an IPC method that offer unidirectional communication. This helps with data p processing. There is also shared memory which obviously has high speed data sharing but needs to watch out for synchronization to avoid race conditions. 


All in all, I earned a ton of new things this week in cst 334 and am excited to be over halfway done with the course. 


Comments

Popular posts from this blog

Week 2 Journal Post

CST 334 Week 7

Week 1: About CSUMB and Online Learning Strategies