I am not able to understand this dependency diagram because there are no arrows in it! Whether thread A should execute first, release thread B and either B releases C or both A and B are required to release C. Kindly guide!
A semaphore is like a mutex but allows access to a certain number of threads at a time. Usually 2 or more. If it was only one at a time you'd just use a mutex.
That being said, based on the problem you have 3 threads I'd assume that they all share a variable, or object (like a file) which you need to protect with a semaphore so that 2 only have access at a time. One doesn't release the other. They'd basically take turns. If threads started a,b,c in order. A and b would access it first, when a is done b & c would access. B done a and c and so on.