CST334 Module 5

What did I learn in the fifth week of CST334?

This week I learned about another four different topics about operating systems. The first topic was about concurrency and threads, which introduces concurrency as an abstraction that manages multiple activities. Basically, this topic goes over a few subjects that determine threads like race conditions and thread state transitions. The former details how threads accessing shard data concurrently without synchronization can become unpredictable and full of bugs. The latter explains how threads can be run, ready, or blocked depending on the operating systems scheduler through the CPU time. The second topic was about threads API, which is about the core idea of how to manipulate threads. Basically, this goes over pthread_create(), pthread_join(), and pthread_exit(). The first one is about the spawning of new thread executed through a given function, the second ensures proper sequencing, while the final one terminates a thread cleanly.

The third topic was about locks and synchronization primitives, which goes over how to prevent race conditions when using mutual exclusion mechanisms. Basically, it goes over spinlocks that repeatedly check until the lock is available, mutexes that suspend a thread when the lock is unavailable, critical sections that deal with code sharing resources, and deadlock conditions that can make threads wait on each other. The final topic was about lock-based data structures, which goes over the way programmers apply locks to build thread-safe structures. Basically, there are two types of locking, and they are fin-grained locking and coarse-grained locking. The former is about having multiple locks protecting different parts of a singular shared structure, while the latter is about only using one lock to protect an entire shared structure. Furthermore, this topic is far more important in theory, as it requires consistency, the avoidance of deadlocks, and managing the performance of the system at the very end.

Comments

Popular Posts