A mutex says: "I’m using this resource; no one else can use it until I’m done," while a semaphore says: "There are this many resources available; take one if you need it.".
#13: Mutex vs. Semaphore
#13: Mutex vs. Semaphore
#13: Mutex vs. Semaphore
A mutex says: "I’m using this resource; no one else can use it until I’m done," while a semaphore says: "There are this many resources available; take one if you need it.".