One of the most interesting sections from this week was the topic of semaphores as a synchronization primitive. Semaphores serve as way to help manage concurrency and work very similarly to locks but rather than just letting one thread access critical sections. Semaphores can allow “n” number of threads through. But by setting s semaphore to a value of 1, it can act just like a binary lock. As threads pass through a semaphore, a counter goes ups and down depending on what integer was initialized. As threads use the semaphore, the value decrements and once it reaches 0, no more threads can make use of the critical section. Once a counter reaches zero, it does the “wait()” operation. As threads finish with the critical section, it lets go of the semaphore and increments the value, allowing another thread to make use of its resources. It can serve as great synchronization tool, when two semaphores are used in tandem. Another synchronization primitive we learned about was ...
Hi Brandon,
ReplyDeleteWow, that's quite a schedule you have there - you look extremely slammed during the week! I think it's great that you have your time planned out so diligently, and it looks like you have some flexibility between errands time and your time during the weekend to get school done. My only advice would be to make sure that you get some time to sleep! As a fellow parent, I know that this is a big challenge (I have a 3rd grader stepson, and I don't think I've slept past 8 at any time in the not-quite-two years since my song was born), but I do think that it's important for both physical and mental health to have some amount of rest as we buckle down through this program.