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

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

2281


How do I run wget?

695


What Command To Take Backup Other Vg's?

799


What does kernel panic mean?

791


Explain about memory management in operating system.

793


What is the meaning of slosh login in nfs?

2276


What is the name of first operating system?

674


How do you fix a crashed computer?

764


What is a file in computer terms?

747


How do you pronounce gnu?

766


What are Odm Commands.

816


When I startup my computer the screen is black?

696


How do I upgrade my operating system?

754


Can we kill init process?

789


How do I run a curl command?

784