in Operating System
436 views
0 votes
0 votes
What is the actual difference between binary semaphore & Mutex????? Are both same thing????

What is the up() code for binary semaphore?????
in Operating System
436 views

4 Comments

1
1
what do you mean by mutex semaphore??
0
0
Sorry about my above comment ,but mutex locks suffers from busy waiting right??
0
0

1 Answer

0 votes
0 votes

They are NOT the same thing.

They are used for different purposes!
While both types of semaphores have a full/empty state and use the same API, their usage is very different.

Mutex is for exclusive access to a resource(data structure, file, etc..).

 A Binary semaphore should be used for synchronization (i.e. "Hey Someone! This occurred!"). The Binary "giver" simply notifies whoever the "taker" that what they were waiting for happened. 

by

Related questions

0 votes
0 votes
1 answer
4