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

Поділитися
Вставка
  • Опубліковано 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

  • @latitzouri
    @latitzouri 2 роки тому +9

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

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

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

  • @equus6460
    @equus6460 10 місяців тому

    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.

  • @AceofSpades5757
    @AceofSpades5757 2 роки тому

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

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

    We need an update/follow up video now :D

  • @user-kn4wt
    @user-kn4wt 11 місяців тому

    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!

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

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

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