why remove the python GIL? (intermediate - advanced) anthony explains

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2021
  • today we talk about the "global interpreter lock" in python and why it currently limits multithreading to 100% usage (and what could be done if it were lifted)
    - nogil project: docs.google.com/document/d/18... github.com/colesbury/nogil
    playlist: • anthony explains
    ==========
    twitch: / anthonywritescode
    dicsord: / discord
    twitter: / codewithanthony
    github: github.com/asottile
    stream github: github.com/anthonywritescode
    I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
  • НаукаНаука

Комментарии • 25

  • @hemis.k3193
    @hemis.k3193 Год назад +1

    Kickass explanation! What I am looking for is some good examples where we are stuck due to GIL but using the java implementation of python Jpython the issue got resolved

  • @latitzouri
    @latitzouri 2 года назад +9

    Removing my grandma in law ? Never thought about it 🤔 could make my python's programming performance increase indeed

  • @stefanAH97
    @stefanAH97 2 года назад +1

    Interesting, high level content. Thnx for sharing

  • @shashishekhar----
    @shashishekhar---- Год назад

    I am thankful for this, what an amazing way to explain this topic.

  • @bilbo1337
    @bilbo1337 2 года назад +7

    Since we’re on the topic I think it would be also good to explain the differences with async python

  • @rosmelylawliet3919
    @rosmelylawliet3919 11 месяцев назад +1

    We need an update/follow up video now :D

  • @AceofSpades5757
    @AceofSpades5757 2 года назад

    That was informative, thanks. I think asyncio would be a good complement to this topic.

  • @user-kn4wt
    @user-kn4wt 10 месяцев назад

    thank you!!

  • @mohamedsaif1928
    @mohamedsaif1928 2 года назад

    Thank You

  • @skarfie123
    @skarfie123 Год назад +1

    With the new pep getting a lot of buzz, I was looking for an explanation and this was great!

  • @equus6460
    @equus6460 9 месяцев назад

    requirement for multy threaded applications in python is limited.
    This defect of single thread runing at a time even if we write multi threaded apps is overshadowed by having varity of modules in python.
    multithreading might not be necessary most of the time and if needed could be over come by writing a rust class and wrapping it with python for speed.

  • @davititchanturia
    @davititchanturia 2 года назад +1

    Nice One. is there any reason why you are not using autocompletion ?

    • @anthonywritescode
      @anthonywritescode  2 года назад +1

      I haven't implemented it yet

    • @UriYakir
      @UriYakir 2 года назад +2

      LOL you should really know by now that Anthony doesn’t need auto completion…

    • @SpeedingFlare
      @SpeedingFlare 2 года назад +1

      He's using an editor he made himself called babi

  • @UriYakir
    @UriYakir 2 года назад +3

    Could you give a few real world examples of where multithreading would actually be useful in the current state of Python? Thanks for the video!

    • @anthonywritescode
      @anthonywritescode  2 года назад +2

      depends... any place where you'd want to do any sort of parallel processing

    • @fiancheg
      @fiancheg 2 года назад +1

      IO operations: file IO, http requests, etc.

    • @KSriram
      @KSriram 2 года назад +3

      @@fiancheg The GIL doesn't lock IO-bound threads. The main advantage of a nogil would be to CPU-bound parallel threads.

    • @DagarCoH
      @DagarCoH 9 месяцев назад

      Have that a bunch with software that connect different sensors and actors to run complex processes. The threads wait for sensor / system input and change the system or the actor state accordingly. In between there are short sleep cycles after which each thread polls for new data / state change

  • @stiffyBlicky
    @stiffyBlicky 2 года назад

    So using one thread in your pool, implies that your work is running serially right?

    • @anthonywritescode
      @anthonywritescode  2 года назад

      a ThreadPool of size 1 would still allow work to happen in the main thread as well (main + 1 background thread) -- but also wouldn't be too terribly useful

  • @burnere633
    @burnere633 2 года назад +3

    Okay, it was quite noticeable and I have to ask: why don't you call it the "gill"?

    • @anthonywritescode
      @anthonywritescode  2 года назад +5

      better for visually impaired (captions) and it reduces ambiguity