What is a difference b/w a semaphore and a mutex?
Sigiloso
A mutex is a resource which will be locked by one thread. If a new thread arrives requesting the same, it will be allocated the resource ONLY if there is no lock on the resource, meaning the previous thread is finished. In a semaphore the same thing applies but multiple threads can time slice the resource and be served. So you will queue up the arriving threads until you reach the MAX queue length and share the resource among all the threads