implement Producer & Consumer using semaphore, mutex and queue