What is a semaphore?

Answer Posted / sri

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 ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I compare files in notepad ++?

524


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

535


How do you reset the bios?

553


When I startup my computer the screen is black?

533


The flushing policy is described in the subsection on process migration strategies: a) From the perspective of the source, which other strategy does flushing resembles? b) From the perspective of the target, which other strategy does flushing resemble?

1818






Why is it called gnu?

550


Is kernel a os?

535


What Command To Restore Backup Of Non - Rootvg?

634


Can I delete old updates to free up disk space?

525


What is difference between post and put method?

532


How do you crash a computer?

526


Can a laptop have both ssd and hdd?

645


Can you just explain about memory management in iOS?

639


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

2084


How do I change my local disk?

528