What are counting semaphores?
Answers were Sorted based on User's Feedback
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
deallocate.
| 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 |
What is multi-tasking, multi-programming,multi-threading?
Which is better ext3 or ext4?
How do I find recently downloaded files?
There is some data related to temperatures of different cities. One side(thread), will be updating the values and multiple clients will be reading the values. how do you achieve synchronization?
Why is ram also known as volatile memory?
What are the different replacement policies ?
Explain Memory Partitioning, Paging, Segmentation?
Explain Page Segmentation.
What is the difference between af_inet and pf_inet?
An Infosys Question : I + Opposite of, W + Initial of, Ice + twice of the letter b4T + 3/4 of X + 15th letter + 1/2 of 0. Please find the answer & mail me
21 Answers HCL, Infosys, Instagram, Nokia, Oracle, Sun Business Solutions,
Which intel processor is 64 bit?
What is chkdsk used for?