ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU-(2020-2021)-1 > student homework > 2018529627050_David Bukedi Diela >
Homework6_2018529627050 Version 0
👤 Author: by wx287_oz26ft1wt2_isbggtha4lgepaasa 2020-11-17 05:40:33
Semaphores are integer variables that are used to solve the critical section problem by using two atomic operations, wait and signal that are used for process synchronization.

The definitions of wait and signal are as follows −

Wait
The wait operation decrements the value of its argument S, if it is positive. If S is negative or zero, then no operation is performed.

wait(S)
{
while (S<=0);

S--;
}
Signal
The signal operation increments the value of its argument S.

signal(S)
{
S++;
}

Example:

Please login to reply. Login

Reversion History

Loading...
No reversions found.