What is semaphore in unix example?



What is semaphore in unix example?..

Answer / Arpit Kapoor

A semaphore in Unix/Linux is a synchronization primitive used to control access to shared resources. It can be thought of as a counter that is incremented and decremented to manage resource availability. For example, if there are 3 available seats in a theater, a semaphore could be initialized to 3, and each ticket sale would increment the semaphore until it reaches 0, indicating no more seats left.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Linux General Interview Questions

is it possible to break the grub password in linux

6 Answers  


what are the different types of ftp servers in linux operating system?

1 Answers   Arigo Infotech,


What is a split-horizon dns?

1 Answers  


Why should I use arch linux?

1 Answers  


Which are the different modes of vi editor?

1 Answers  


Can spinlock be interrupted?

1 Answers  


What do you type to stop a hung process that resists the standard attempts to shut it down?

1 Answers  


how do you monitor or measure performance of a linux server which is running for more than 5 years with out a break?

1 Answers  


How do you check if a particular service in running?

1 Answers  


What is systemd in linux?

1 Answers  


Is mac a linux or darwin?

1 Answers  


How many types of bond are there in linux?

1 Answers  


Categories