Week 5: CST334 Journal

 This week we learned about concurrency in operating systems and topics like threads and locks. We learned the differences between processes and threads, and how threads share memory and have separate execution states. We also learned about how threads allow for concurrency and enable a single process to utilize multiple CPU cores. We also learned how they can prevent blocking by interleaving execution. We learned about critical sections and the need for mutual exclusion to avoid race conditions. We also learned about how the pthreads library is used to manage threads, using functions like pthread_create to create threads, pthread_join to wait for a specific thread to complete, and various functions related to locks like pthread_mutex_lock and pthread_mutex_unlock. 

We learned about how locking is used in multithreaded programming to handle synchronization between threads. We learned that locks prevent multiple threads from entering critical sections. We also learned about the need for efficient lock construction, and the importance of fairness, performance, and correctness. The lecture described several types of locks such as spin locks and atomic instructions (test-and-set, compare-and-swap, and fetch-and-add). We also learned about drawbacks of locks such as fairness issues and the inefficiency of spin locks. We also learned about software-based approaches that involve spin-waiting and queueing threads.

We went over some of the advantages of multithreading (how it compares to single-threaded processes). We learned that threads are lightweight processes that share the address space and for the parallel execution of tasks. This results in a more efficient use of resources. Multithreading also results in reduced memory consumption, easier communication through shared memory, and improved performance on multi-core processors.

Comments

Popular posts from this blog

Journal Week 4

Week 5: CST438 Journal

This week