Write a note on Semaphore.
4 years ago
Operating System
A semaphore S is an integer variable that, apart from initialization, is accessed only through two standard atomic operations: wait and signal. These operations were originally termed P (for wait; from the Dutch proberen, to test) and V (for signal; from verhogen, to increment). The classical definition of wait in pseudocode is
wait(S) {
while (S <= 0)
; // no-op S --;
}
The classical definitions of signal in pseudocode is Signal(S){
S++;
}
Surya Bikram Bhandari
Nov 4, 2021