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

wha is very first process created by kernel

628


What is Cycle Stealing in OS?

604


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?

1822


What is a file in computer terms?

536


How do I change my local disk?

530






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

607


Explain the term shell.

612


Assuming one link of the Trojan horse copy-and-observe-later chain is broken. There are two other possible angles of attack by Alice: Alice logging on and attempting to read the string directly, and alice assigning a security level of sensitive to the back-pocket file. Does the reference monitor prevent these attacks?

2394


Which processor is better amd or intel?

579


Which is your favorite editor, shell, programming shell and why?

2086


What is the latest version of google browser?

559


How do you clear cache on a laptop?

543


When I press power button on laptop nothing happens?

485


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

579


Is 4 cores enough for streaming?

605