May 2020
Intermediate to advanced
496 pages
13h 54m
English
Counting semaphores are most often used to manage a shared resource that has limitations on the number of simultaneous users. Upon creation, they can be configured to hold a maximum value, called a ceiling. The example normally given for counting semaphores is readers in a database ... Well, we're talking about an MCU-based embedded system here, so let's keep our examples relevant. If you're interested in databases, you're probably better off with a general-purpose OS! For our example, let's say you're implementing a socket-based communication driver and your system only has enough memory for a limited number of simultaneous socket connections.
In the following diagram, we have a shared network resource that can accommodate ...