Тёмный

Semaphore Vs. Mutex - A Clear Understanding 

Shriram Vasudevan
Подписаться 49 тыс.
Просмотров 100 тыс.
50% 1

Here you go.. The clear differences between Semaphore and Mutex. All the technical aspects are discussed with examples for each.

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 193   
@navya5679
@navya5679 4 года назад
I finally get what the difference is, after all these years. Will definitely watch this whenever I need to revise.
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Glad Navya. The purpose of my hard work through this channel is getting served when I see these kinds of messages.
@dipanshupayasi790
@dipanshupayasi790 4 года назад
Thanks for simplifying this in easier manner. I have got doubt, will be glad you can answer it. Suppose we have three "writing thread" writing a message into a message queue and one "reading thread" which needs to read the message from the queue. So in this case to synchronize the process we can either go ahead with "Binary Semaphore", which will allow only one thread to read or write at a time or using mutex by locking the resource. Now the question is which method should be preferred and why? (in context with RTOS in embedded systems) Thanks in advance :)
@hrishibhagat3281
@hrishibhagat3281 3 года назад
Best way to differentiate between mutex and semaphore Thank you Sir ! Finally I understood Diffeernce between them
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks brother
@celsiusfahrenheit1176
@celsiusfahrenheit1176 4 года назад
God, thank you, you were able to simplify this so well, after watching many videos and reading other resources I finally got it.
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Glad u liked it
@bandarulekhana2678
@bandarulekhana2678 3 года назад
Thank you so much sir once again 😊😊
@washiburr9876
@washiburr9876 4 года назад
Oh my god. Thank you so much. This was confusing me so much when my professor was explaining it.
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Glad you found it useful..
@bharathiraja6286
@bharathiraja6286 4 года назад
You saved a lot of time. This clears a lot and lot. Keep doing this!!!
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Glad u liked
@sbanavasi
@sbanavasi Год назад
Thank you Dr.Shriram for the very simple and crystal clear presentation on differences between semaphores and mutex. I look forward to your presentation on oneAPI Hands-on Workshop- Let us SYCL. Thank you
@ShriramVasudevan
@ShriramVasudevan Год назад
Sure and soon
@jankeshchakravarthy9389
@jankeshchakravarthy9389 11 месяцев назад
Hi Shriram - Nice and very clear video describing the concept of mutex vs. spin locks vs semaphores. I have couple of follow up question/requests 1. Can semaphore, mutex, spin locks work across the processors? For example, if the mutex used by two threads running two different CPUs, will it work? 2. What is the underlying assembly instructions for spin locks? You can take type processor, like ARM.
@ravikumarsivasankar2735
@ravikumarsivasankar2735 3 года назад
Thanks Shriram Vasudevan. The video is very simple and easy to understand. The real life examples are very good
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks Ravi. Glad you liked.. subscribe :)
@SkandanKA
@SkandanKA 4 года назад
This was so precise and highly effective.. Please continue making more and more videos.. Thanks a lot ❣️
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks and glad you liked it
@zach6383
@zach6383 3 года назад
Great explanation and clear english, Thank you!
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks n glad u liked
@VagaDuo
@VagaDuo 3 года назад
Thank you so much for clear explanation. I have one question: In you last point, you told: - When more than one resources available: use Semaphore (that should be counting semaphore). - When only one resource available: use Mutex. Can we not use binary semaphore instead of mutex? Why mutex is preferred over binary semaphore?
@HimanshuSharma-sd5gk
@HimanshuSharma-sd5gk 3 года назад
Generally semaphore is prone to getting into dead lock
@rathanhv4676
@rathanhv4676 3 года назад
As a fresher it helped me to understand the concept clearly please add more videos on threads.
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks and glad u found it useful
@bandarulekhana2678
@bandarulekhana2678 3 года назад
Now i am very very very clear about this topics sir thank you thank you so much sir .......keep going and help the people like us 🙏🙏
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks n glad u liked
@erigelavani4162
@erigelavani4162 4 года назад
Sir your explanation is very clear and understandable 👌,Thank you sir keep doing more videos sir.
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks Vani. Glad you found it meaningful
@ozanh
@ozanh Год назад
Brilliant explanation sir. It helped me a lot on my RTOS project.
@ShriramVasudevan
@ShriramVasudevan Год назад
Glad.
@TheCoolharry123
@TheCoolharry123 2 года назад
Process and thread word used interchangeably here. Mutex and semaphore used for synchronizing threads in a process. Mutex and semaphore not available across multiple process.
@anasalamin84
@anasalamin84 4 года назад
thanks (Shriram Vasudevan) alot for the best explanation that i found on the web I like the symbols you used and the direct simple language you use
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Glad u liked it brother
@SSi934
@SSi934 5 месяцев назад
Excellent Teaching - So simple.
@ravikishorepochiraju6973
@ravikishorepochiraju6973 2 года назад
Excellent Explanation Appreciate the effort, Thanks and GoodLuck for other Vids
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Thanks brother
@Amunisify
@Amunisify 4 года назад
You have explained it so clearly! I have one question if semaphore and mutex are different then in book “Operating System Concepts” there’s a Bounded buffer problem. In that they have taken three semaphores. And one semaphore is “semaphore mutex = 1” how’s that possible? Can you/anyone explain?? Please.
@ShriramVasudevan
@ShriramVasudevan 4 года назад
I shall go through that and come back to u
@2109abhishek
@2109abhishek 3 года назад
best video on youtube to understand the Semaphore and Mutex
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks and great to know you liked it
@vishalyadav1064
@vishalyadav1064 3 года назад
Thanks a lot. It was little confusing before. Such a clear explanation in this video
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks brother. Glad u liked
@cheeku5568
@cheeku5568 4 года назад
really it was a clear cut lecture...thanks for the nice session...keep posting such clear cut lectures
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks and glad you found it good
@umeshtiwari9249
@umeshtiwari9249 7 месяцев назад
clear all doubts in semaphore and mutex. thanks Sir
@ShriramVasudevan
@ShriramVasudevan 6 месяцев назад
Keep watching
@saadmanahmed860
@saadmanahmed860 4 года назад
a very good illustration. thanks for such great tutorial
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks
@UdayKumar_G
@UdayKumar_G Год назад
Simple and crisp explaination . Thanks :)
@ShriramVasudevan
@ShriramVasudevan Год назад
Thanks
@profdurgahere9007
@profdurgahere9007 3 года назад
This is one of the best. Hatsoff!
@CosmJJ
@CosmJJ 5 месяцев назад
Thanks a lot! Crystal clear explanation
@ShriramVasudevan
@ShriramVasudevan 5 месяцев назад
Thanks
@ssrmurthysaka6324
@ssrmurthysaka6324 4 года назад
Can we call binary semaphore as a mutex? Because counter value 1 means resource is available when counter is 0 resource is blocked for one process.
@srikanthsarjanaa8075
@srikanthsarjanaa8075 3 месяца назад
Such a great explanation 🙌🙌
@sumitnaik1990
@sumitnaik1990 3 года назад
Is it possible to use multiple mutex object when multiple resource are present ? If yes then why we need Semaphore ?
@biprarshidutta1560
@biprarshidutta1560 Год назад
Great Lecture! However I was surprised you didn't talk about priority inversion in Mutexes only
@ShriramVasudevan
@ShriramVasudevan Год назад
Great suggestion! I will make it
@mnbvcxz1621
@mnbvcxz1621 2 года назад
simple and neat, please provide more examples.
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Sure and thanks
@teamqis7382
@teamqis7382 2 года назад
Woowww. Very easy and excellent insights.
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Glad it was helpful!
@cp8245
@cp8245 3 года назад
Awesomely explained sir. Thank you
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Glad u liked it
@sreevanijalagari3863
@sreevanijalagari3863 3 года назад
that was super clear!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks
@aayush5474
@aayush5474 4 года назад
Isn't Mutex and Binary Semaphore the same then because both will allow only one process to access the resource at a time?
@Revathy84
@Revathy84 6 месяцев назад
Excellent explaination
@MegaUncleDrew
@MegaUncleDrew 3 года назад
Now when would you choose a binary semaphore over a mutex?
@Joyddep
@Joyddep 3 года назад
Thank you Sir, really clear explanation!
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks n glad u liked bro.
@muralinagraj1983
@muralinagraj1983 3 года назад
Whether one or more resources we can always use semaphore only rite ? because binary semaphore works good for one resource and counting semaphores works good when there are many resources. Why we have to use mutex and get confused when semaphore works for both ?
@techforall9859
@techforall9859 2 года назад
Excellent! The best! Superb.
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Thank you! Cheers!
@TheSoorajthevally
@TheSoorajthevally 3 года назад
Hello Shriram .. Clean explanation.
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks and glad u liked
@Amarsharma-n9y
@Amarsharma-n9y 11 месяцев назад
What happens in case of mutex when we have mutiple resource?
@naveendoki3667
@naveendoki3667 2 года назад
Very good explanation !
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Thanks
@archanao4143
@archanao4143 4 года назад
thank you Soooooo much sir And plz explain abt spin locks also sir.. Plz
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Will be done tomorrow. Glad you liked it...
@rohitjadhav512
@rohitjadhav512 3 года назад
Great explanation n English tooo
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks
@techhunter877
@techhunter877 4 года назад
Thanks. This is very informative
@arun.s1059
@arun.s1059 Год назад
Very good explanation 👍👍👍
@ShriramVasudevan
@ShriramVasudevan Год назад
Glad u like.
@KRKUN
@KRKUN 2 года назад
Thanks for explaining that was helpful, if you can improve your accent that will be great
@whistlingpalms2240
@whistlingpalms2240 3 года назад
Thanks a lot sir... Very helpful...
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks and glad u liked it priyanka
@anillone9094
@anillone9094 2 года назад
sir, can we use semaphore for both thread and process? or can we use mutex for both thread and process? means is there any rule that semaphore should be use with process or mutex should be use with thread?
@indrajansboorlagadda1706
@indrajansboorlagadda1706 3 года назад
If we have one shared resource...we can use binary semaphore also instead of mutex...can you tell me where is the exact usage of these semaphore and mutex !?
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Well.. there wont be a fight for the resources
@shaikmahammadusman8543
@shaikmahammadusman8543 3 года назад
Good explanation but we need more examples binary semaphore and counting semaphore
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Shall make another video soon
@asharafperinchikkal6103
@asharafperinchikkal6103 3 года назад
Nice man ..you did great job 👍
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks and glad u liked
@allmighty2000
@allmighty2000 4 года назад
So just tell the MUTEX Is a kind of BINARY Semaphore that’s it , that’s all I needed to know , this subject is so dramatic 😂😂 BTW thanks a lot for this video , loved this
@preethamdasari
@preethamdasari 4 года назад
Nope they are not the same thing.
@aayush5474
@aayush5474 4 года назад
@@preethamdasari In the OS galvin book the author says on some systems binary semaphore is also called mutex lock
@askiny6576
@askiny6576 3 года назад
@@preethamdasari the way he explained it, they are the same. did he explain it wrong?
@pammidhun
@pammidhun 4 года назад
Suppose I have one resource. Then which one I should go for.? Binary semaphore or mutex.? Why.?
@HritikV
@HritikV 4 года назад
Mutex, as mentioned in the video. Mutex is simpler.
@balakrishna121
@balakrishna121 3 года назад
Lovely explanation
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks and glad u liked
@Amarsharma-n9y
@Amarsharma-n9y 11 месяцев назад
Is binary semaphore same as mutex?
@kotamuralikrishna6851
@kotamuralikrishna6851 2 года назад
In ubuntu how to change fonts(tamil, telugu) settings to display
@slowedandreverb2079
@slowedandreverb2079 2 года назад
Which one is better for windows10 and linux?
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Linux
@srikanthgali9424
@srikanthgali9424 4 года назад
Hi Shriram, I have one query here .. when only one resource is available, which one to choose .. Binray semaphore or Mutex.
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Hi. For a single resource it is Binary Semaphore preferred
@narayansingh-bu5fk
@narayansingh-bu5fk 4 года назад
@@ShriramVasudevan in last you have conclude that for one resource mutex is preferred so Now for one resource mutex is preferred or binary semaphore ?
@yihan4835
@yihan4835 4 года назад
Very clear explanations.
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks.
@jameysiddiqui6910
@jameysiddiqui6910 3 года назад
so binary semaphore is equal to mutex
@sakshiwahi2025
@sakshiwahi2025 2 года назад
This was the best!
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Thanks shakshi
@adityasahu96
@adityasahu96 3 года назад
woah nice explaination !
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thank you
@satyamgaba
@satyamgaba 3 года назад
Why is mutex better when there are two resources?
@ankammaraochintala2509
@ankammaraochintala2509 3 года назад
Thank you
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Welcome
@nathand256
@nathand256 3 года назад
Insightful! Thanks
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Glad u liked
@indramaniarora7901
@indramaniarora7901 4 года назад
So isn't it possible to use semaphores everywhere instead of mutex?
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Yes
@shreyashachoudhary480
@shreyashachoudhary480 2 года назад
Loved it!
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Thanks❤
@AbhijeeetKumarSrivastavakshiva
@AbhijeeetKumarSrivastavakshiva 3 года назад
Mutex types?
@Pages_Perfected
@Pages_Perfected 2 года назад
any summary?
@roshanrajkumar7827
@roshanrajkumar7827 4 года назад
Sir can u make a video on virtual memory ...pages and frames??
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Already there. Go through brother
@pavanv4115
@pavanv4115 4 года назад
Please make all os videos
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Pl check the same playlist. All os contents are there.
@pavanv4115
@pavanv4115 4 года назад
Threads virtual memory some important topic are not available
@ShriramVasudevan
@ShriramVasudevan 4 года назад
@@pavanv4115 threads are there. Check. VM i will make soon.
@adithyashankar6562
@adithyashankar6562 4 года назад
Clear explanation. This video is very useful
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks and glad u liked.
@finalyearprojects4915
@finalyearprojects4915 2 года назад
Excellent lesson bro learned lot... thank you
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Glad it was helpful!
@vinothkannanr2804
@vinothkannanr2804 4 года назад
such a great video
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks
@mostafayasin1
@mostafayasin1 Год назад
Thaanks
@ShriramVasudevan
@ShriramVasudevan Год назад
Thank you
@brandonhughes645
@brandonhughes645 3 года назад
Why do I even go to university.
@pea2nuts809
@pea2nuts809 2 года назад
Problem is audio is too quiet
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Pl use earphones.
@its_mee_ssr
@its_mee_ssr 4 года назад
Nice explanation
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks brother
@roshanrajkumar7827
@roshanrajkumar7827 4 года назад
Sir...who takes care of this..??os huh??btw where is semaphore and mutex stored or implemented???????sec men or RAM?
@ShriramVasudevan
@ShriramVasudevan 4 года назад
OS that is the kernel does everything. You got to code for the semaphore or mutex..it's just a software piece.
@stith_pragya
@stith_pragya 8 месяцев назад
Jai Shree Ram🙏🙏🙏🙏🙏🙏🙏🙏🙏 Excellent explanation...Thanks a ton for the video🙏🙏🙏
@ShriramVasudevan
@ShriramVasudevan 8 месяцев назад
Thanks brother
@engineering1year734
@engineering1year734 2 года назад
Good video sir
@ShriramVasudevan
@ShriramVasudevan 2 года назад
Thanks
@sstech6695
@sstech6695 4 года назад
Nice. Concise.
@elumalair5875
@elumalair5875 3 года назад
super sir thank you
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks and glad u liked
@selflearner8895
@selflearner8895 3 года назад
Thank u sir🙏
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Glad u liked
@hrishibhagat3281
@hrishibhagat3281 3 года назад
Sir can I get these slides?
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Lemme see
@nikolayd4384
@nikolayd4384 4 года назад
Thank you, sir!
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Welcome bro
@Gamechanger..601
@Gamechanger..601 10 месяцев назад
Wow... Thanks
@ShriramVasudevan
@ShriramVasudevan 10 месяцев назад
Glad u liked
@adeli583
@adeli583 4 года назад
Thanks Sriram Vasudevan. Can I have your email to communicate you for more lessons?
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Glad you liked it.
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Reach me @ shriramkv@gmail.com
@shivamkeshri9540
@shivamkeshri9540 4 года назад
Great great and only great.
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thank you.
@TEXOTALKSPRAVEEN
@TEXOTALKSPRAVEEN 4 года назад
superb
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks
@tushargoyaliit
@tushargoyaliit 3 года назад
Nice
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks and glad u liked
@sumitkumarsagar6876
@sumitkumarsagar6876 3 года назад
nice!
@ShriramVasudevan
@ShriramVasudevan 3 года назад
Thanks.
@adigenius04
@adigenius04 4 года назад
Woww! Respect++
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks
@dok.bswamy7504
@dok.bswamy7504 4 месяца назад
👍
@SUNILRAJAK183
@SUNILRAJAK183 4 года назад
nice
@ShriramVasudevan
@ShriramVasudevan 4 года назад
Thanks n glad u liked
Далее
Interprocess communication - Named Pipe or FIFO.
8:20
Semaphores
22:51
Просмотров 474 тыс.
How Many Twins Can You Spot?
00:17
Просмотров 23 млн
Women’s Free Kicks + Men’s 😳🚀
00:20
Просмотров 6 млн
Mutex VS Semaphore In C++
7:17
Просмотров 15 тыс.
What's Spin Lock? Spin Lock Vs. Mutex.
5:07
Просмотров 31 тыс.
FANG Interview Question | Process vs Thread
3:51
Просмотров 324 тыс.
Difference between Binary Semaphores and Mutexes
6:04
Introduction to semaphores in C
12:24
Просмотров 125 тыс.
MUTEX SEMAPHORE in an RTOS and its USE
11:34
Просмотров 9 тыс.
Semaphore Explained C#
12:24
Просмотров 41 тыс.
19.2.6 Worked Examples: Semaphores
7:32
Просмотров 47 тыс.
Introduction to Java Semaphores - Java Programming
15:23
How Many Twins Can You Spot?
00:17
Просмотров 23 млн