binary semaphore vs mutex

binary semaphore take 0 and 1 values. so we may think only 1 thread can access the resource.
but in semaphore there is nothing like ownership of resource and also other thread can
increment the semaphore . In mutex only the thread which acquired the lock can release the lock and the
thread is owner of the lock. developers uses mutex for  mutually exclusive lock instead of binary semaphore.

No comments: