Semaphore Vs. Mutex - A Clear Understanding

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 พ.ย. 2024

ความคิดเห็น • 194

  • @navya5679
    @navya5679 4 ปีที่แล้ว +3

    I finally get what the difference is, after all these years. Will definitely watch this whenever I need to revise.

    • @ShriramVasudevan
      @ShriramVasudevan  4 ปีที่แล้ว +4

      Glad Navya. The purpose of my hard work through this channel is getting served when I see these kinds of messages.

  • @celsiusfahrenheit1176
    @celsiusfahrenheit1176 4 ปีที่แล้ว +13

    God, thank you, you were able to simplify this so well, after watching many videos and reading other resources I finally got it.

  • @hrishibhagat3281
    @hrishibhagat3281 3 ปีที่แล้ว +5

    Best way to differentiate between mutex and semaphore Thank you Sir ! Finally I understood Diffeernce between them

  • @bharathiraja6286
    @bharathiraja6286 4 ปีที่แล้ว +4

    You saved a lot of time. This clears a lot and lot. Keep doing this!!!

  • @sbanavasi
    @sbanavasi ปีที่แล้ว +1

    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

  • @washiburr9876
    @washiburr9876 4 ปีที่แล้ว +9

    Oh my god. Thank you so much. This was confusing me so much when my professor was explaining it.

  • @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 :)

  • @ozanh
    @ozanh ปีที่แล้ว

    Brilliant explanation sir. It helped me a lot on my RTOS project.

  • @zach6383
    @zach6383 3 ปีที่แล้ว +3

    Great explanation and clear english, Thank you!

  • @SSi934
    @SSi934 6 หลายเดือนก่อน

    Excellent Teaching - So simple.

  • @jankeshchakravarthy9389
    @jankeshchakravarthy9389 ปีที่แล้ว +1

    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.

  • @UdayKumar_G
    @UdayKumar_G ปีที่แล้ว

    Simple and crisp explaination . Thanks :)

  • @SkandanKA
    @SkandanKA 4 ปีที่แล้ว +3

    This was so precise and highly effective..
    Please continue making more and more videos..
    Thanks a lot ❣️

  • @2109abhishek
    @2109abhishek 3 ปีที่แล้ว

    best video on youtube to understand the Semaphore and Mutex

  • @dipanshupayasi790
    @dipanshupayasi790 4 ปีที่แล้ว +9

    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 :)

  • @ravikishorepochiraju6973
    @ravikishorepochiraju6973 2 ปีที่แล้ว

    Excellent Explanation Appreciate the effort, Thanks and GoodLuck for other Vids

  • @rathanhv4676
    @rathanhv4676 3 ปีที่แล้ว

    As a fresher it helped me to understand the concept clearly please add more videos on threads.

  • @CosmJJ
    @CosmJJ 6 หลายเดือนก่อน

    Thanks a lot! Crystal clear explanation

  • @stith_pragya
    @stith_pragya 9 หลายเดือนก่อน +1

    Jai Shree Ram🙏🙏🙏🙏🙏🙏🙏🙏🙏
    Excellent explanation...Thanks a ton for the video🙏🙏🙏

  • @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 🙏🙏

  • @sreevanijalagari3863
    @sreevanijalagari3863 3 ปีที่แล้ว +2

    that was super clear!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @srikanthsarjanaa8075
    @srikanthsarjanaa8075 4 หลายเดือนก่อน

    Such a great explanation 🙌🙌

  • @teamqis7382
    @teamqis7382 3 ปีที่แล้ว

    Woowww. Very easy and excellent insights.

  • @profdurgahere9007
    @profdurgahere9007 3 ปีที่แล้ว

    This is one of the best. Hatsoff!

  • @umeshtiwari9249
    @umeshtiwari9249 8 หลายเดือนก่อน

    clear all doubts in semaphore and mutex. thanks Sir

  • @saadmanahmed860
    @saadmanahmed860 4 ปีที่แล้ว

    a very good illustration. thanks for such great tutorial

  • @finalyearprojects4915
    @finalyearprojects4915 2 ปีที่แล้ว +1

    Excellent lesson bro learned lot... thank you

  • @vishalyadav1064
    @vishalyadav1064 3 ปีที่แล้ว

    Thanks a lot. It was little confusing before. Such a clear explanation in this video

  • @Revathy84
    @Revathy84 7 หลายเดือนก่อน

    Excellent explaination

  • @techforall9859
    @techforall9859 3 ปีที่แล้ว

    Excellent! The best! Superb.

  • @naveendoki3667
    @naveendoki3667 2 ปีที่แล้ว

    Very good explanation !

  • @whistlingpalms2240
    @whistlingpalms2240 3 ปีที่แล้ว

    Thanks a lot sir... Very helpful...

  • @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

  • @cp8245
    @cp8245 3 ปีที่แล้ว

    Awesomely explained sir. Thank you

  • @erigelavani4162
    @erigelavani4162 4 ปีที่แล้ว +1

    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

  • @rohitjadhav512
    @rohitjadhav512 3 ปีที่แล้ว

    Great explanation n English tooo

  • @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.

  • @mnbvcxz1621
    @mnbvcxz1621 3 ปีที่แล้ว

    simple and neat, please provide more examples.

  • @VagaDuo
    @VagaDuo 3 ปีที่แล้ว +5

    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 ปีที่แล้ว +1

      Generally semaphore is prone to getting into dead lock

  • @arun.s1059
    @arun.s1059 ปีที่แล้ว

    Very good explanation 👍👍👍

  • @cheeku5568
    @cheeku5568 4 ปีที่แล้ว

    really it was a clear cut lecture...thanks for the nice session...keep posting such clear cut lectures

  • @Amarsharma-n9y
    @Amarsharma-n9y ปีที่แล้ว

    What happens in case of mutex when we have mutiple resource?

  • @deeptanudatta7235
    @deeptanudatta7235 11 วันที่ผ่านมา

    What is the difference between mutex and binary semaphore ?

  • @sumitnaik1990
    @sumitnaik1990 3 ปีที่แล้ว +1

    Is it possible to use multiple mutex object when multiple resource are present ?
    If yes then why we need Semaphore ?

  • @aayush5474
    @aayush5474 4 ปีที่แล้ว +1

    Isn't Mutex and Binary Semaphore the same then because both will allow only one process to access the resource at a time?

  • @TheSoorajthevally
    @TheSoorajthevally 3 ปีที่แล้ว

    Hello Shriram .. Clean explanation.

  • @Joyddep
    @Joyddep 3 ปีที่แล้ว

    Thank you Sir, really clear explanation!

  • @balakrishna121
    @balakrishna121 3 ปีที่แล้ว

    Lovely explanation

  • @MegaUncleDrew
    @MegaUncleDrew 3 ปีที่แล้ว

    Now when would you choose a binary semaphore over a mutex?

  • @slowedandreverb2079
    @slowedandreverb2079 2 ปีที่แล้ว

    Which one is better for windows10 and linux?

  • @ssrmurthysaka6324
    @ssrmurthysaka6324 4 ปีที่แล้ว +1

    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.

  • @asharafperinchikkal6103
    @asharafperinchikkal6103 3 ปีที่แล้ว

    Nice man ..you did great job 👍

  • @nathand256
    @nathand256 3 ปีที่แล้ว

    Insightful! Thanks

  • @sakshiwahi2025
    @sakshiwahi2025 2 ปีที่แล้ว

    This was the best!

  • @kotamuralikrishna6851
    @kotamuralikrishna6851 2 ปีที่แล้ว

    In ubuntu how to change fonts(tamil, telugu) settings to display

  • @ankammaraochintala2509
    @ankammaraochintala2509 3 ปีที่แล้ว +1

    Thank you

  • @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 ปีที่แล้ว +1

      Well.. there wont be a fight for the resources

  • @techhunter877
    @techhunter877 4 ปีที่แล้ว

    Thanks. This is very informative

  • @mostafayasin1
    @mostafayasin1 2 ปีที่แล้ว

    Thaanks

  • @adityasahu96
    @adityasahu96 3 ปีที่แล้ว

    woah nice explaination !

  • @yihan4835
    @yihan4835 4 ปีที่แล้ว

    Very clear explanations.

  • @Amunisify
    @Amunisify 4 ปีที่แล้ว +1

    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

  • @shreyashachoudhary480
    @shreyashachoudhary480 2 ปีที่แล้ว

    Loved it!

  • @biprarshidutta1560
    @biprarshidutta1560 ปีที่แล้ว

    Great Lecture! However I was surprised you didn't talk about priority inversion in Mutexes only

  • @Amarsharma-n9y
    @Amarsharma-n9y ปีที่แล้ว

    Is binary semaphore same as mutex?

  • @allmighty2000
    @allmighty2000 4 ปีที่แล้ว +1

    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?

  • @vinothkannanr2804
    @vinothkannanr2804 4 ปีที่แล้ว

    such a great video

  • @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 ?

  • @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?

  • @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.

  • @srikanthgali9424
    @srikanthgali9424 4 ปีที่แล้ว +1

    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 ?

  • @adithyashankar6562
    @adithyashankar6562 4 ปีที่แล้ว

    Clear explanation. This video is very useful

  • @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...

  • @Pages_Perfected
    @Pages_Perfected 2 ปีที่แล้ว

    any summary?

  • @AbhijeeetKumarSrivastavakshiva
    @AbhijeeetKumarSrivastavakshiva 3 ปีที่แล้ว

    Mutex types?

  • @elumalair5875
    @elumalair5875 3 ปีที่แล้ว

    super sir thank you

  • @selflearner8895
    @selflearner8895 3 ปีที่แล้ว

    Thank u sir🙏

  • @hrishibhagat3281
    @hrishibhagat3281 3 ปีที่แล้ว

    Sir can I get these slides?

  • @Gamechanger..601
    @Gamechanger..601 11 หลายเดือนก่อน

    Wow... Thanks

  • @engineering1year734
    @engineering1year734 2 ปีที่แล้ว

    Good video sir

  • @indramaniarora7901
    @indramaniarora7901 4 ปีที่แล้ว

    So isn't it possible to use semaphores everywhere instead of mutex?

  • @shivamkeshri9540
    @shivamkeshri9540 4 ปีที่แล้ว

    Great great and only great.

  • @nikolayd4384
    @nikolayd4384 4 ปีที่แล้ว

    Thank you, sir!

  • @KRKUN
    @KRKUN 2 ปีที่แล้ว

    Thanks for explaining that was helpful, if you can improve your accent that will be great

  • @its_mee_ssr
    @its_mee_ssr 4 ปีที่แล้ว

    Nice explanation

  • @sstech6695
    @sstech6695 4 ปีที่แล้ว

    Nice. Concise.

  • @satyamgaba
    @satyamgaba 3 ปีที่แล้ว

    Why is mutex better when there are two resources?

  • @adeli583
    @adeli583 4 ปีที่แล้ว

    Thanks Sriram Vasudevan. Can I have your email to communicate you for more lessons?

  • @roshanrajkumar7827
    @roshanrajkumar7827 4 ปีที่แล้ว

    Sir can u make a video on virtual memory ...pages and frames??

  • @pavanv4115
    @pavanv4115 4 ปีที่แล้ว +1

    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.

  • @jameysiddiqui6910
    @jameysiddiqui6910 4 ปีที่แล้ว

    so binary semaphore is equal to mutex

  • @shaikmahammadusman8543
    @shaikmahammadusman8543 3 ปีที่แล้ว

    Good explanation but we need more examples binary semaphore and counting semaphore

  • @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.

  • @dok.bswamy7504
    @dok.bswamy7504 5 หลายเดือนก่อน

    👍

  • @tushargoyaliit
    @tushargoyaliit 3 ปีที่แล้ว

    Nice

  • @pea2nuts809
    @pea2nuts809 2 ปีที่แล้ว

    Problem is audio is too quiet

  • @TEXOTALKSPRAVEEN
    @TEXOTALKSPRAVEEN 4 ปีที่แล้ว

    superb

  • @sumitkumarsagar6876
    @sumitkumarsagar6876 3 ปีที่แล้ว

    nice!

  • @adigenius04
    @adigenius04 4 ปีที่แล้ว

    Woww! Respect++

  • @brandonhughes645
    @brandonhughes645 3 ปีที่แล้ว +1

    Why do I even go to university.