Recursive Mutex In C++

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

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

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

    I am beginner at C++, I came to it from java. Java learning is never a bad idea but I am enchanted to C++ by its speed and flexibility in coding world which ironically most of new programmer hates XD.
    But really great job at explaining the videos, really great explanations and simple. Keep the great job legend and I hope to see more of your videos related to C++.

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

      you gonna love GoLang, it has more flexibility of writing codes and its much more efficient than java.

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

    You doing a great job! Keep going :)

    • @CppNuts
      @CppNuts  5 ปีที่แล้ว

      Sure man!!
      Thanks for the comment!!

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

    @1:53 and @4:44, it is actually not waiting for that lock , it will throw the run-time error if the same thread is trying to lock itself the second time.

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

    Extremely helpful that opens my mind a lot. Tks!!!

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

      Glad to hear it!

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

    pratical impelementation in last would be cherry on cake!

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

    Thank you Sir! I am giving interviews with the help of your videos only.
    One suggestion, just for visual better presentation. The comments section in your videos, the text colour is very light. Those points are very important, and while watching loose focus or interest on those points. Could you please change the colour of the comments section, to brighter colour? Thank you for all the valuable contents. Regards.

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

    @12:34 I'd place the code at line 38 inside the lock after line 36. Otherwise, it will cause some messy outputs on some random executions!

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

    Your thread seriese is awesome. :)

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

      Thanks man..

  • @kevin-ru6oe
    @kevin-ru6oe 4 ปีที่แล้ว +3

    The code:
    // Example 1: With recursion
    #include
    #include
    #include
    using namespace std;
    std::recursive_mutex m1;
    int buffer = 0;
    void recursion(char c, int loopFor){
    if(loopFor < 0){
    return;
    }
    m1.lock();
    cout

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

    Nice explanation Sir,
    we are waiting for your videos on c++

    • @CppNuts
      @CppNuts  5 ปีที่แล้ว

      Thanks for the comment dude!!
      Sure there are so many videos coming on c++.

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

    Great explanation.Thank u

    • @CppNuts
      @CppNuts  5 ปีที่แล้ว

      Thanks for the comment dude!

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

    Concept wise i understood but i have a question.
    Why to go for recursive mutex.
    It can be done by simple mutex .Just we need to take care that only one thread should be accessing the critical section and it can be done by keeping the function call in mutex.
    Means instead of keeping mutex inside the function why not keep mutex lock from where the fucntion is getting called?
    If I am missing some point where it can fail,Please let me know.

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

      because the lock will not let the same thread to acquire lock again. results in deadlock

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

    Hi I got concept of this...thank you very much....I have a doubt in example.. first coding example illustrates recursive lock... If recursive call is made from function , it could have been made post we do unlock.... i.e. do unlock first and then call recursive call.. does this not work...? General question is that assume recursive function has critical section but who or which limits us to unlock mutex before self calling?

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

    the video helped me a lot

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

      Glad it helped!!

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

    Hi may I please know which software do you use to draw using that sketch style drawings ? You explain really well !

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

    Please add videos for c++11 features, lamda function, for each etc..

    • @CppNuts
      @CppNuts  5 ปีที่แล้ว +2

      Sure man now i am in mood to complete these 11/14/17/20 list.

  • @kevin-ru6oe
    @kevin-ru6oe 4 ปีที่แล้ว +1

    if you can put the code in your blog, it would be very helpful for us. Thanks for your videos.

  • @ergingokkaya8323
    @ergingokkaya8323 5 ปีที่แล้ว +2

    I was afraid when the warning suddenly appeared😄

    • @CppNuts
      @CppNuts  5 ปีที่แล้ว

      :D :D

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

    There is something called recursive_timed_mutex.
    Can you give a video on it.

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

    excelent

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

      Thanks..

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

    Nice work :) , please upload threading playlist code file on git hub

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

      Thanks @Anshu..
      You can become a small member of my channel, then you can get code for any video. (It's very cheap)

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

    TH-cam lacked you.