Operating System semaphore


Operating System semaphore

Operating System semaphore - August 06, 2008 at 18:10 pm by Amit Satpute

What is a semaphore? 

A semaphore is a variable. There are 2 types of semaphores:

Binary semaphores
Counting semaphores

Binary semaphores have 2 methods associated with it. (up, down / lock, unlock)
Binary semaphores can take only 2 values (0/1). They are used to acquire locks. When a resource is available, the process in charge set the semaphore to 1 else 0.

Counting Semaphore may have value to be greater than one, typically used to allocate resources from a pool of identical resources.

Operating System mutex - May 06, 2009 at 18:10 PM by Vidya Sagar

What is difference between binary semaphore and mutex?

The differences between binary semaphore and mutex are:

  • Mutex is used exclusively for mutual exclusion. Both mutual exclusion and synchronization can be used by binary.
  • A task that took mutex can only give mutex.
  • From an ISR a mutex can not be given.
  • Recursive taking of mutual exclusion semaphores is possible. This means that a task that holds before finally releasing a semaphore, can take the semaphore more than once.
  • Options for making the task which takes as DELETE_SAFE are provided by Mutex, which means the task deletion is not possible when holding the mutex.
Operating system - What is a semaphore? - Jan 07, 2010 at 15:00 PM  by Vidya Sagar

What is a semaphore?

A semaphore is hardware or a software tag variable whose value indicates the status of a common resource. Its purpose is to lock the resource being used. A process which needs the resource will check the semaphore for determining the status of the resource followed by the decision for proceeding. In multitasking operating systems, the activities are synchronized by using the semaphore techniques.


Write your comment - Share Knowledge and Experience

Discussion Board

good & understandble for every studnt

tejaswi 10-1-2015 02:39 AM

Use of Semaphore

Semaphore very use full, Specially Binary semaphores.

Mehdi 12-15-2013 12:02 PM


It s very usefulll....

sathish 10-3-2013 10:07 AM


definition good.
explain semaphore with example

vipul 05-1-2013 10:41 AM


short answer is good but long is not sufficient , can you explain briefly

manohar 04-30-2013 10:48 PM


Good explanation

palanisamy 04-24-2013 11:35 PM

Semaphore assignment

I enjoy the respound to my question

Dennis 03-4-2013 04:30 PM


what is function of semaphore....

ranjit kumar 02-11-2013 06:19 AM

Semaphore and Mutex

If you want generic understanding of semaphore and mutex you can check the video


It explains it in a basic way.

Vijay 01-21-2013 06:41 PM



sreeniga 11-17-2012 07:05 AM


i understand. vvvv good

shabir 07-15-2012 04:41 AM


good explanation.

preeti 06-8-2012 12:30 PM


More operating system links

Explain the meaning of Kernal.

Answer - The kernel is the essential center of a computer operating system, the core that........            

Explain the basic functions of process management.

Answer - The basic functions of the OS wrt the process management are :........

What is a named pipe?

Answer - A connection used to transfer data between separate processes, usually on separate computers. ........

Latest placement tests
Latest links
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us