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

Do cores matter for gaming?

562


What should I consider when buying a laptop?

546


How do I combine multiple folders on a mac?

553


Can I restore my computer to yesterday?

554


What is a file in os?

624






Is chrome an operating system?

543


Which processor is better amd or intel?

581


What is gnu os?

563


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

581


What is the meaning of slosh login in nfs?

2108


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


Can yum install rpm?

658


How do I clean up and speed up my computer?

531


How do you reset your computer?

560


How do I compare plugins in notepad ++?

579