What is a semaphore?

Answer Posted / aditya singh

In programming, especially in Unix systems, semaphores are a
technique for coordinating or synchronizing activities in
which multiple processes compete for the same operating
system resources. A semaphore is a value in a designated
place in operating system (or kernel) storage that each
process can check and then change. Depending on the value
that is found, the process can use the resource or will find
that it is already in use and must wait for some period
before trying again. Semaphores can be binary (0 or 1) or
can have additional values. Typically, a process using
semaphores checks the value and then, if it using the
resource, changes the value to reflect this so that
subsequent semaphore users will know to wait.

Semaphores are commonly use for two purposes: to share a
common memory space and to share access to files. Semaphores
are one of the techniques for interprocess communication
(IPC). The C programming language provides a set of
interfaces or "functions" for managing semaphores.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens if you turn off computer during update?

647


What is difference between kernel and os?

724


How many bytes we can send to apple push notification server in iOS operating system?

819


Does a disk cleanup delete everything?

734


Explian T - Factor?

813


What is a file in os?

778


discuss the procedures to evaluate disk excess time

2325


Can I restore my computer to yesterday?

737


Which is better curl or wget?

782


What is the most powerful computer in the world 2019?

742


How many goroutines are in a core?

736


Where can I get a free operating system?

695


How do I make a pdf file on my laptop?

706


What are different errors encountered while compiling?

926


Is microsoft coming out with a new operating system?

693