Qt 6 - Episode 25 - Sharing resources between threads

Поділитися
Вставка
  • Опубліковано 5 лис 2024

КОМЕНТАРІ • 10

  • @priyeshgupta164
    @priyeshgupta164 3 роки тому +1

    Nice 👍 thank you 🙏

  • @echosystemd
    @echosystemd Рік тому

    Worker::run is locked by a mutex. But why Worker::set_count doesn't need a mutex to lock it?

    • @kingshanaman
      @kingshanaman 11 місяців тому

      Correct me if I'm wrong, but this is what I believe is happening: The short answer is that we don't need a mutex lock for Worker::set_count because set_count is not changing a shared variable. Worker::set_count is altering the worker's own variable and not the shared variable.
      The long answer:
      Imagine that each worker is a real person in a car and a mutex lock is traffic light. The shared variable is a target, past the traffic light, that needs to be hit. Now, each worker needs to know the address of the target, and so it has it's own notebook where it writes down this address. In this case, the notebook is the variable. Since each worker has it's own variable we don't need a mutex lock to protect it because we will never encounter a situation where another worker has access to another worker's notebook. But since there is only one target, we need a mutex lock so that only one worker, at a time, gets past the traffic light to hit the target .

  • @ngoclevan2061
    @ngoclevan2061 3 роки тому

    Is this course as complete as the paid course on Udemy?

    • @VoidRealms
      @VoidRealms  3 роки тому +2

      No the Udemy courses go into more detail and I make these UA-cam videos with a different code style so the material is not repetitive or redundant

    • @ngoclevan2061
      @ngoclevan2061 3 роки тому

      @@VoidRealms I'm from Vietnam, courses for QT / QML in Vietnam are very few. Do you do QML with QT6 ?

  • @mananbhardwaj3976
    @mananbhardwaj3976 3 роки тому

    when will you teach gui qt

    • @VoidRealms
      @VoidRealms  3 роки тому +4

      Soon actually, I just want to cover some more basics but I don't want to get too deep because I already cover all the basics in my courses. I'm thinking about covering networking and maybe some library creation and then going gui

    • @mananbhardwaj3976
      @mananbhardwaj3976 3 роки тому +2

      @@VoidRealms ok got i am just a 12 year old kid i have basic understanding of c++ and qt

  • @NaimulHoque777
    @NaimulHoque777 3 роки тому +1

    😀😃✌🤘👌👍🥉🥉🥉