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

Can a laptop have both ssd and hdd?

644


How do I make a pdf file on my laptop?

510


Is chrome os better than windows 10?

523


What is difference between post and patch?

586


What is concurrency go?

575






Do cores matter for gaming?

552


what are latest technologies ? and how will keep yourself up to date ?

2445


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

2869


Why is my computer so slow?

546


What causes a corrupt operating system?

525


How do you fix a computer that won't start up?

515


How To Convert A Normal Vg To Big & Scalable Vg And Also Big To Scalable Vg?

603


what kind of operating(s)systems would be needed (and explain why) in an environment where there exist various cluster of networks which are all interconnected in different geographical areas with strong emphasis on online applicating process.

1649


When I press power button on laptop nothing happens?

479


Explain the term shell.

610