This is the first entry in the “Classical synchronization problems” chapter of “The Little Book of Semaphores”, the “producer-consumer problem”.
The text describes the problem as a common pattern where some threads are producers and some thread...
For $WORK reasons, I want an up-to-date Go cross compiler for OpenEmbedded. Taking a look at existing efforts I ended up forking dodgerblue’s repository in order to fix a couple of issues, most notably, the fact that in order to bootstrap 1.5, the recipe goes behind bitbake...
The first time I used Go to solve the particular puzzle I’d like to discuss in this post, I though I was doing something wrong because the solution is so concise.
Secton 3.7 of the Little Book of Semaphores presents the following puzzle:
Imagine that goroutines represent b...
At the end of Let’s meet, I wrote: “The channel-based solution has one advantage going for it, though: try surrounding the body of the worker in a for loop.” This is what The Little Book of Semaphores calls a “reusable barrier” in section 3.6. It&rsq...
I skipped over “Chapter 2: Semaphores” because it doesn’t contain exercises. Nevertheless, looking back at it, I think it’s worth paying it a visit with Go in mind.
The Little Book of Semaphores offers the following properties as a definition for a semapho...
Chapter 3 of The Little Book of Semaphores proposes the following puzzle:
Generalize the signal pattern so that it works both ways. Thread A has to wait for Thread B and vice versa.
If Thread A runs two statements a1 and a2, and Thread B runs two statements b1 and b2, the requi...
In the introduction to The Little Book of Semaphores (TLBOS), the author presents the following puzzle (rephrased a little):
Imagine that Alice and her friend Bob live in different cities, and one day, around dinner time, Alice starts to wonder who ate lunch first that day, she...
The Little Book of Semaphores, by professor Allen Downey, is a textbook that introduces the principles of synchronization for concurrent programming. It’s available under the GNU Free Documentation License. The book uses Python to illustrate the concepts, but I think Go is...
Hello, world! My regular blog doesn’t really have a main topic, but in recent years it has kept going along the general theme of politics in Costa Rica, with occasional wanderings into information technology. That (and the fact that it’s written in Spanish) has kept m...