Tuesday, July 23, 2024

CST 334 - Week 5

For this module, the main focus was concurrency. This topic introduces the idea of a thread, which could be thought of similarly to a process. The difference being that in multi-threaded programs, the individual threads have access to the same address space. Threads are useful for two major reasons: parallelism, which allows you to execute different parts of a program simultaneously, and to avoid blocking program progress due to slow I/O operations. To utilize threads, we need to be able to create and end individual threads, of course. But we also need to know when each should run. To do this, we incorporate locks to provide mutual exclusion, which basically means that only one thread at a time can enter a critical section of code.

One of the biggest challenges for me this week was trying to wrap my head around how this works under the hood. I've used threads on a basic level to ensure proper input to an automation project I worked on the past, but have never really dug into the intricacies of how they work in tandem with the hardware. 

No comments:

Post a Comment