This week we learned about semaphores and their role in synchronizing processes in computer science. Semaphores are synchronization tools used to manage concurrent processes by utilizing counters to control access to shared resources. They can be categorized into binary semaphores, which only take values 0 and 1, and act like a lock, and counting semaphores, which can take non-negative integer values to allow multiple processes to access a finite number of resources. Understanding semaphores is essential for ensuring that concurrent processes do not cause conflicts or data corruption.
We also learned how to use semaphores in coding. We learned to write simple code with semaphores that involved initializing the semaphore, and performing wait and signal operations. By controlling the semaphores we ensured that resources were accessed in a controlled manner. We also learned a little about other synchronizations variables like monitors and were able to see the tradeoffs between the different techniques. This week I was able to learn a great deal more about synchronization and the importance of careful resource management in concurrent programming.
Comments
Post a Comment