> For the complete documentation index, see [llms.txt](https://chenxing-cao.gitbook.io/space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chenxing-cao.gitbook.io/space/multi-threading/mutex-vs-semorphore.md).

# Mutex vs Semorphore

{% embed url="<https://www.guru99.com/mutex-vs-semaphore.html>" %}

* Mutex is a locking mechanism whereas Semaphore is a signaling mechanism
* Mutex is just an object while Semaphore is an integer
* Mutex has no subtype whereas Semaphore has two types, which are counting semaphore and binary semaphore.
* Semaphore supports wait and signal operations modification, whereas Mutex is only modified by the process that may request or release a resource.
* Semaphore value is modified using wait () and signal () operations, on the other hand, Mutex operations are locked or unlocked.
