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 I install chrome os on my laptop?

540


What happens if you turn off computer during update?

478


What is the best os for laptop?

537


Explian T - Factor?

650


what is multitask win95

552






How do you say gnu?

518


discuss the procedures to evaluate disk excess time

2152


What is the best memory for a laptop?

554


How much ram do I need for streaming?

546


When I startup my computer the screen is black?

526


Do simultaneous downloads take longer?

544


Why does kernel panic occur?

542


How do I clean up and speed up my laptop?

487


Can I delete old updates to free up disk space?

513


In the token-passing mutual exclusion algorithm, is the timestamping used to reset clocks and correct drifts, as in the distributed queue algorithms? if not, what is the function of the timestamping?

2273