Which of the following statements is true about binary semaphores? I. V(s) is defined as [s = s + 1 ] and P(s) is defined as [while(s <= 0) {wait}; s = s-1] II. The value of the semaphore takes on only the values 0 and 1. code example

Example: computing semaphore

In computer science, a semaphore is a variable or abstract data type used to control access to a common resource by multiple processes in a concurrent system such as a multitasking operating system. A semaphore is simply a variable. This variable is used to solve critical section problems and to achieve process synchronization in the multi processing environment. A trivial semaphore is a plain variable that is changed (for example, incremented or decremented, or toggled) depending on programmer-defined conditions.

Tags:

Misc Example