What is a semaphore?

Answer Posted / thangavelu t

semaphore is integer variable that used to achieve mutual
exclusion.
it always indicates no of resource instances available.

programming example:
code
{
acquire(s);
critical region;
release(s);
}

acquire(semaphore s)
{
while(s==0);
s--;
}
release(semaphore s)
{
s++;
}
init(semaphore s,int instances)
{
s=instances;//initializes to no of resources instances
}

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you crash a computer?

532


How do I clean up and speed up my computer?

527


What are the Types Of Vg & Explain About Them?

586


discuss the procedures to evaluate disk excess time

2163


Which is better curl or wget?

593






Can I factory reset my laptop without a recovery disc?

547


What causes a computer not to boot up?

490


Is i3 good for gaming?

581


How do I run a curl command?

560


What happens if you turn off computer during update?

492


How do I make a pdf file on my laptop?

514


How do you remove a virus from your computer?

523


How much memory do I need on my laptop?

568


How do I clean up my computer to make it run faster?

535


How do you find out computer specs?

522