What is the significance of the initial value of a semaphore?

multithreading, operating-system

Solution

Semaphores are a way of coordinating multiple threads of control, not just for mutual exclusion. For example, a classical fixed-size producer-consumer queue may use a semaphore initialized to a non-zero value for producers so that they block when there are too many elements in the buffer.

Problem

A semaphore is a mechanism for avoiding race conditions. But what's the significance of the initial value of a semaphore? Say that a semaphore has an initial value of 5, is it that 5 processes can access some shared resource simultaneously?

Original source