Software Synchronization Puzzles Multithreaded applications often require synchronization constraints; for example, we might require one thread to write a value before another thread tries to read it. A semaphore is a software building block that can be used to enforce arbitrarily complex constraints, but getting the details right can be challenging. In the Little Book of Semaphores, I present this material using a series of puzzles, starting with basic patterns, working through classical synchronization problems like Readers-Writers and Dining Philosophers, and ending with some new problems constructed by my students. In this talk I will introduce semaphores, basic synchronization patterns and a few classical problems. I will demonstrate (and test) solutions to these problems using an animated thread simulator called Sync. The Little Book of Semaphores and Sync are available from Green Tea Press. Allen Downey is an Associate Professor of Computer Science at the Olin College of Engineering in Needham MA, and a Visiting Scientist at Google, Inc. He is the author of How to Think Like a Computer Scientist and several other Free Books.
Read the original here:
Allen Downey