- #1
momentum
- 111
- 0
I am trying to understand Semaphore. It says
A semaphore controls access to a shared resource through the use of a counter. If the counter is greater than zero, then access is allowed. If it is zero, then access is denied.
Source: https://www.geeksforgeeks.org/semaphore-in-java/
My Question:
Why there is no count-- in the flow diagram?
I only see count++ & count>0 .in the flow diagram? how count will be decremented then?
Is this flow diagram correct?
A semaphore controls access to a shared resource through the use of a counter. If the counter is greater than zero, then access is allowed. If it is zero, then access is denied.
Source: https://www.geeksforgeeks.org/semaphore-in-java/
My Question:
Why there is no count-- in the flow diagram?
I only see count++ & count>0 .in the flow diagram? how count will be decremented then?
Is this flow diagram correct?