Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semaphore vs Mutex #3

Closed
AdityaPai2398 opened this issue Jul 1, 2018 · 2 comments
Closed

Semaphore vs Mutex #3

AdityaPai2398 opened this issue Jul 1, 2018 · 2 comments

Comments

@AdityaPai2398
Copy link
Contributor

Great Collection! 💯

But in https://github.com/SuyashLakhotia/TechInterview/blob/master/5%20-%20OS%20Fundamentals.md#mutexes--semaphores you've mentioned that "They differ only in that a semaphore's integer may start at a number greater than 1."

I don't think it's that accurate because a mutex is locking mechanism used to synchronize access to a resource, while Semaphore is signaling mechanism (“I am done, you can carry on” kind of signal).

Source : https://www.geeksforgeeks.org/mutex-vs-semaphore/

Let me know if I'm wrong :)

@SuyashLakhotia
Copy link
Owner

Good catch! You're right that they mean different things despite the possibility of having similar implementations (i.e. binary semaphore ≠ mutex).

If you'd be kind enough to send a PR, I'll review & merge it ASAP! Else, I'll update it on master soon.

@AdityaPai2398
Copy link
Contributor Author

Done!
Please review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants