write a note on the usage of semaphoressemaphore


Write a note on the usage of semaphores.

Semaphore is a synchronization tool and it is a variable having integer values. It is accessed only by two standard atomic operations wait and signal. These operation were initially termed p(for wait) and v(for signal).

                The traditional definition for wait in pseudocode is:

 

                             wait(s)  {

                                         while(s<=0)

                                           ;//no-op

                                         s--;

                                          }

             The traditional definition for signal in pseudo code is:

 

                            signal(s) {

                                             s++;

                                           }

Alteration to the integer value of the semaphore in the wait and signal operations should be executed indivisibly. i.e., when one process alters the semaphore value .No other process is able to simultaneously modify that same semaphore value. Additionally in the case of wait(s) the testing of the integer value of s (s<=0) and its possible modification (s--) must as well be executed without interruption.

Request for Solution File

Ask an Expert for Answer!!
Operating System: write a note on the usage of semaphoressemaphore
Reference No:- TGS0307462

Expected delivery within 24 Hours