Semaphores
Definition
typedef struct
{
unsigned int val; /* can not be negative */
PROCESS *queue; /* queue of waiting blocked processes */
} SEMAPHORE;An implementation of semaphores

Bounded-buffer problem
Problem statement
Implementation


Solving using semaphores

Wrong solution

Analysis of semaphores
Advantages
Disadvantages
Last updated