Semaphore: A lock with a counter (IRL: A flag that transmits a signal over a long distance)

Why semaphore?

Types

Binary Semaphore: Count = 0/1, sem_init(1)

Counting Semaphore: sem_init(N > 1)

Limitations