What are counting semaphores?

Answers were Sorted based on User's Feedback

Answer / swetcha

Counting semaphore -Locks a shared resource against
simultaneous access by multiple threads
A counting semaphore is a generalization of a mutex
semaphore that locks a shared resource against simultaneous
access by multiple threads. All resource allocation
functions, such as wait() and post() , take an optional
parameter defining the number of resources to allocate or

Is This Answer Correct ?    11 Yes 5 No

Answer / kiruthiga

Semaphore is a nonnegative integer count. Semaphores are
typically used to coordinate access to resources, with the
semaphore count initialized to the number of free
resources. Threads then atomically increment the count when
resources are added and atomically decrement the count when
resources are removed.

When the semaphore count becomes zero, no more resources
are present. Threads that try to decrement the semaphore
when the count is zero block until the count becomes
greater than zero.

Is This Answer Correct ?    7 Yes 4 No

Answer / arshiya

Counting semaphores are a synchronization primitive that
allow threads to wait until an event has occurred. The event
may be generated by a producer thread, or by a DSR in
response to a hardware interrupt.

Is This Answer Correct ?    8 Yes 8 No

Answer / nagi

Binary semaphore or mutex is used for single resouce
locking.where as counting semaphone is a variable counter
whose value will be initilised to number of resources
present.one can acees the resource if semaphore value is
greater than zero.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Operating Systems General Concepts Interview Questions

main() { charstr1="prakash"; charstr2="raju"; Str1=str2; printf("\n%d",str1); }

7 Answers   GE, IBM,

What is a trap and trapdoor?

8 Answers   TCS,

Why paging is used?

2 Answers  

What is the difference between Authoritative restore & Non- Authoritative restore?

1 Answers   Wipro,

how many types of operating system?

18 Answers   IBM,

List the Coffman's conditions that lead to a deadlock?

2 Answers   HP, HCL, Cap Gemini,

How many Logical ports are available in OS? eg.23 for Telnet like this what is total number of available ports?

2 Answers   eClinicalWorks,

semaphore is

4 Answers   BFL,

How do an incremental process model and certification work together to produce high quality software? In your own words, describe the intent of certification in the clean room software engineering context.

0 Answers  

What is FtDisk?

1 Answers  

What are demand- and pre-paging?

4 Answers  

Discuss the various function of OS.

6 Answers   HCL, Spectrum Solutions, Spectrum,