Semaphores, counting semaphores, binary semaphores in Operating systems OS

What are semaphores?

  • Semaphores are the variables.
  • Semaphores are used for signaling among processes.
  • Three kinds of operations are performed on semaphores;
    1. To initialize the semaphore
    2. To increment the semaphore value
    3. To decrement the semaphore value

What are binary semaphores?

Binary semaphores take only the values in between 0 to 1.

What are counting semaphores?

Counting semaphores have the non-negative integer value.

How can processes get the critical section?

  • A critical section is controlled by semaphores by following operations;
    • Wait:
      • Any process can’t enter into the critical section.
      • Semaphore value is decremented.
    • Signal:
      • The process can enter into the critical section.
      • Semaphore value is incremented.


difference between binary and counting semaphores

Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....