For clarity:
bolludagur is an annual event, where bakers produce a whole lot of
bolla, which is a kind of pastry. It is often made out of three things, the plain
bolla itself, chocolate and cream.
I'm not sure if this requires more explanation. You can refer to my solution for the swimmers problem to see semaphores being used. Remember they have a value, which essentially tells us how many processes can pass the semaphore, and then they have two operations wait(), that decrements the semaphore value and then checks if the process can pass the semaphore (is the value >= 0), and signal() that increments the semaphore value, and checks if there is a process waiting to pass the semaphore (is the value <= 0).
The wikipedia page on semaphores has some useful information, as well as a library analogy that does a decent enough job of explaining the concept.
The following is a snippet from the wikipedia page:
Semaphores which allow an arbitrary resource count are called counting semaphores, while semaphores which are restricted to the values 0 and 1 (or locked/unlocked, unavailable/available) are called binary semaphores. And a small hint is that we should only use binary semaphores to solve this (i'm not sure if a solution using counting semaphores is possible, it might be, but the most straight-forward solution uses only binary semaphores)
Last edited by Mavoor; 03-09-2016 at 12:57 PM.