Semaphore is used to control the number of threads executing. There will be fixed set of resources. The resource count will gets decremented every time when a thread owns the same. When the semaphore count reaches 0 then no other threads are allowed to acquire the resource. The threads get blocked till other threads owning resource releases. In short, the main difference is how many threads are allowed to acquire the resource at once ? Mutex --its ONE. Semaphore -- its DEFINED_COUNT, ( as many as semaphore count)
http://stackoverflow.com/questions/3513045/conditional-variable-vs-semaphore