Understanding Python: Threading

Поділитися
Вставка
  • Опубліковано 6 вер 2024
  • In this video, I go over threading.
    Included in the lesson is an introductory tutorial covering the basics, background, and some best practices of threading.
    As always, if you have any questions or suggestions for future videos, please leave a comment down below.
    Follow me on Twitter: / jakejcallahan
    Source: github.com/Jac...
    Timelapse music: 失望した by Eva
    Link: • EVA - 失望した [Synthwave]...
    Outro music: Elix by Synthness
    Link: • Synthness - Elix ★ No ...

КОМЕНТАРІ • 17

  • @JakeCallahan
    @JakeCallahan  Рік тому +4

    Let me know if you want me to do a deeper dive into threading in the future. Also, remember that the source code for this video, and all others in this series, can be found here: github.com/JacobCallahan/Understanding/

  • @ruiwang113
    @ruiwang113 18 днів тому

    This is the best video for understanding python thread easily!

  • @abadulhassan4651
    @abadulhassan4651 3 місяці тому

    very useful and nice content explained very simply.

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

    I always wanted someone to do a deep dive into the nuanced topics of Python such as how actually threads work and the GIL. Have looked around for good implementations for so long. Finally seem to have found it. Amazing work!

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

      Thank you very much. I've considered doing a series of even deeper dives (into the implementation themselves), but too many other things to get to first.

  • @sergioernestotostadosanche2509
    @sergioernestotostadosanche2509 4 місяці тому

    Hi, dude. You got my subscription, thanks for sharing thoughtfully!

  • @Diablo-qp3iz
    @Diablo-qp3iz 7 місяців тому

    You are the best explainer among all the UA-camrs I've seen. 👍🏻👍🏻👍🏻
    But I often have a question.
    Assuming I am preparing to write a Third party API hub, which contains 10 independent external party APIs with no dependencies but finally we need to transform and append all their response in json.In this situation, would you choose to use asynchronous programming or multi-threading?

    • @JakeCallahan
      @JakeCallahan  7 місяців тому +1

      If you're not heavily depending on synchronous libraries and are comfortable with asynchronous programming, then I'd recommend async over threading.
      For example, if you can use something like aiohttp to interact with those APIs, it's hard to beat async.
      The downside is that it does make your design a bit more complicated, but it's a good trade-off.

  • @cheesecake_mafia
    @cheesecake_mafia Місяць тому

    Hi Jake, excellent tutorial. I absolutely love your content on youtube. It feels like a crime to be able to learn this free of cost.
    Anyways, Im guessing you already know this, but we could use the python's inbuilt map method with the ThreadPoolExecutor like executor.map(func_name, list_of_args) . It just feels a bit more readable. That way we could just loop over the futures object to get the results and not use the .as_completed() method, assuming the func_name function returns something.
    Cheers and Kudos!!

    • @JakeCallahan
      @JakeCallahan  Місяць тому

      Thank you very much. You're definitely definitely correct that using map is anither easy way to do this, especially for those that are more used to functional programming

    • @cheesecake_mafia
      @cheesecake_mafia Місяць тому

      @@JakeCallahan Just something I realised about the map method. It returns the future objects in the order they were started and not in the order they finish. It might be helpful to someone who also cares about the order in which threads finished, incase the result is being passed on to someother function/class for which order matters.

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

    Definitely do another video on this subject! It goes deep and you are great at explaining it!

  • @taft-rh
    @taft-rh Рік тому

    SUPER INFORMATIVE! Thanks for the detailed dive!

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

    When do you make the Video about Multi-Processing?

    • @JakeCallahan
      @JakeCallahan  Рік тому +1

      I'm planning to release it near the end of the month. I'm currently on a monthly schedule, but may sprinkle in a surprise soon as well.

  • @H4K0N42
    @H4K0N42 Рік тому +1

    Very good video