What is a semaphore?

Answer Posted / jethva_trupti

A semaphore, a new variable type.
A semaphore could have the value 0,indicating that no
wakeups were saved, or some positive values if one or more
wakeups were pending.
a semaphore s is an integer variable that apart from
initialization, is accesssed only through two standard
atomic operations, wait and signal. these operations were
orignially termed p(for wait to test) and v(for signal to
increment).
The classical defination of wait in psedocode is
wait(s)
{
while(s<=0)
;// no-op
s--;
}
The classical defination of signal in psedocode is
signal(s)
{
s++;
}
Modification to the integer value of smaphore in wait and
signal operations must be executed individually.
that is, when one process modifies the semaphore value no
other process can simultaneously modifiy that same
semaphore value.

Is This Answer Correct ?    68 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I increase storage on my laptop?

707


Give some examples of use of thread in a single user multiprocessing system

6368


i want information about real time operating systems because i have an interview tomoorow in valeo company.

3222


Difference Between Jfs & Jfs2?

780


What is difference between post and put method?

763


what is multitask win95

777


windows 3.1 is

741


Is the higher the ghz the better?

717


Explain about memory management in operating system.

791


The flushing policy is described in the subsection on process migration strategies: a) From the perspective of the source, which other strategy does flushing resembles? b) From the perspective of the target, which other strategy does flushing resemble?

2017


Why context switching is overhead?

829


Assuming feedback to the adversary flugging an error as each incorrect character is entered, what is the expected time to discover the correct password?

3081


When I startup my computer the screen is black?

694


What is the difference between the OS which you use and other OSs?

763


describe the situation in which priority inversion can occur

1083