I've recently read up about Semaphores and get most of the logic.
Except for the fact that,
When let's say the value of Semaphore is 5, that means 5 threads can't enter the critical section, but how do we make sure these 5 threads don't try to access the same resource again causing a concurrency problem.
Is it something we are supposed to manage manually?