Raymond Hettinger, Keynote on Concurrency, PyBay 2017

Поділитися
Вставка
  • Опубліковано 10 січ 2025

КОМЕНТАРІ • 88

  • @senpos
    @senpos 7 років тому +117

    Oh, i see Raymond Hettinger - i press "Like" :-) Thanks for upload!

  • @baconsledge
    @baconsledge 6 років тому +39

    Raymond is a pleasure to watch and listen to, and makes Python awesome.

  • @kennys1881
    @kennys1881 5 років тому +18

    I'm a simple man.. I see Raymond Hettinger, I click the video

  • @PhilippeCarphin
    @PhilippeCarphin 4 роки тому +6

    One of the things I liked from "The Pragmatic Programmer" about concurrency was that he also says that it can make it easier to reason about your problem when you free yourself from certain ordering problems.

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

    when he said an easy problem even for high school students. I learnt my first for loop when I was 25 and fell in love with programming.

  • @simonmasters3295
    @simonmasters3295 6 років тому +51

    40k views, 1k likes and only 29 comments, most of which are boring.
    This is probably one of the most important, relevant, compelling, authentic videos on the subject of
    "How to program intelligently"
    After 30 years of coding experience I am prepared to go back to square one because I know it makes sense. The stuff at 33.30 "ASYNC is the future...ASYN maxes CPU, Existing code and libraries, ASYNC means you will have to re-tool..." is pure gold.

    • @csmole1231
      @csmole1231 4 роки тому +2

      30 yrs of coding! your view of the world must be wonderful!

  • @DivineZeal
    @DivineZeal 6 років тому +8

    I looked at this a few months ago as a python newbie...few months later this all makes sense and am excited to make the complete transfer to async with my future projects. lots of web app / automation ideas

  • @saadistik
    @saadistik 6 років тому +10

    What an excellent talk. I wish they had let him delve into the detail of that last piece of code.

  • @nuraortap7881
    @nuraortap7881 6 місяців тому

    What a wonderful and insightful orator and educator.

  • @armynyus9123
    @armynyus9123 4 роки тому +2

    I still find it supersad that gevent does not get the awareness it deserves, imho. No other language offers the convenience of converting a syncronously written program, threaded or not, cooperatively async - with a single line of code, which patches *all* blocking ops into non blocking, taking care of all the callback handling behind the scenes. This is beautiful.
    Example: His test question at 34:45 - we had that, had to stop blocking on a telnet/ssh using threaded framework, partially 3rd party, partially from us, since number of comm. sockets increased into the 100ks - one import gevent + patch and that was it. No other change. Paradise, imho.

  • @pablo_brianese
    @pablo_brianese 3 роки тому +7

    This craziness is how I came to understand why functional programming has value.

  • @feddeschaeffer7116
    @feddeschaeffer7116 4 роки тому +5

    From what I got out of the talk, the difference between threads and async/await for existing codebases comes down to these two alternatives:
    - changing all the bits of code that could leave shared scopes or output in an inconsistent state if other tasks interrupt them, or
    - changing the bits that would ‘block’ other tasks by doing I/O or holding the CPU for so long that it feels like ‘it hangs’.
    The message repeated in the talk, then, is that the former is easier, since the changes just involve wrapping the access to shared state/effects with locks on some convenient level. In the async/await version, they would usually require diving all the way down the call graph and replacing the I/O call, or the entire library call it's hard-coded in.
    But isn't it much easier to iteratively _find_ idly waiting I/O calls and other things that cause noticeable slowdowns, than it is to find all places that touch references to the same sets of mutable object attributes until you feel safe that it's correct?

  • @KurzedMetal
    @KurzedMetal 6 років тому +5

    Just brilliant!!! He just captured my attention the whole time.

  • @nelsonmacy1010
    @nelsonmacy1010 4 роки тому

    Great talk. Great teacher. Distills the lesson for good summary.

  • @Geza_Molnar_
    @Geza_Molnar_ 5 років тому +2

    46:30
    ...and it happend : airplane, automatic control of flight
    (plus non-disciplined / non-experienced devs (=cheap), conflict of interest in auditing and authorizing the new feature, etc.)

  • @mujkocka
    @mujkocka 4 роки тому

    Hope to see you in Montreal again!

  • @stoneshou
    @stoneshou 7 років тому +116

    there must be a harder way!

    • @pallenda
      @pallenda 7 років тому +27

      "so we can get paid for it" that made me laugh. :)

    • @astroblurf2513
      @astroblurf2513 4 роки тому

      What other convention speaker do you know who has their own catch phrase?

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

    Best explanation about differences and use cases!

  • @Seebergster
    @Seebergster 5 років тому +4

    Python is extremely popular in the gaming community . . just not for run time code :D It's used a TON for production pipelines and tool writing

  • @ChristophZwerschke
    @ChristophZwerschke 7 років тому

    Nice talk. Only at 57:40 it was a bit confusing when you scrolled to the code using locks while still talking about queues.

  • @vcool
    @vcool 7 років тому +1

    I find *multiprocessing.Barrier* and *threading.Barrier* useful because unlike .join(), these don't expect the process or thread to be terminated. Also, of course use a Queue instead if that'll conveniently do the job.

  • @aoeu256
    @aoeu256 5 років тому +4

    Haha async / co-routines were used lots in the 1970s and 1980s. Its just that people forgot about them because the goto was removed from Python and Java, and C's longjmp was weird...

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

      You don't need goto to do async/coroutines; and in fact, it wouldn't really help in implementing async/coroutines anyway.
      And goto wasn't "removed from Python", it never has goto.

  • @NeoAF10
    @NeoAF10 6 років тому +2

    This blew away my mind!

  • @alexl2512
    @alexl2512 9 місяців тому

    Happened to see this. I learned so much out of it.😮

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

    "How can we make this hard, co we can be paid for it?" quote worth remembering

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

    "an electonical computer" woah mr fancy pants with his electricity.

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

    Are slices available somewhere? Great talk!

  • @coding3438
    @coding3438 2 місяці тому

    What happens when I pull the plug on the printer? Does it stop then?

  • @fuanka1724
    @fuanka1724 6 років тому +29

    Very interesting talk, too bad asyncio was so lightly covered, very good nonetheless.

    • @danielschmider5069
      @danielschmider5069 5 років тому +2

      I don't think it was lightly covered, 30% of a 1.25 hour video is still a lot more coverage than a 15 minute video talking exclusively about it. Obviously there's still more to explore

  • @MrGarg10may
    @MrGarg10may 6 років тому +1

    The code part with fuzz all over doesn't have a race condition, due to GIL there will be the lock on the counter whenever any thread is trying to upgrade. The final value of the counter would always be the same. Race condition means final value changes may be because two threads read the same value while incrementing. If one wants to print Counter value sequentially as Raymond is trying to do, they can simply synchronize the function.

  • @rewtnode
    @rewtnode 7 років тому +2

    Very interesting and instructive! Now it would be really great if we could actually get the code examples. The Dropbox link doesn't work.

    • @SFPython
      @SFPython  7 років тому +4

      Dropbox changed public links. Moved to pybay.com/site_media/slides/raymond2017-keynote/index.html

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

    thanks , is this editor vim or emacs

  • @chawza8402
    @chawza8402 4 роки тому

    where is the guy that share the timestamps?

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

    Is there a worse way though?

  • @Billabongesta
    @Billabongesta 4 роки тому +2

    I learned something new!

  • @tiagodagostini
    @tiagodagostini 4 роки тому +1

    I alwasy listen that fallacy that locks are expensive to acquire. A lock is effectively 1 single assembly instruction, test and set, on a modern CPU. There are other issues that are serious, but to say locks are expensive to acquire is simply wrong.

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

      Test set and a loop when the test fails. Also, that test and set instruction is one of the most expensive assembly instruction, because it causes the CPU core to need to interrupt all the other CPU cores and synchronize to make sure that the none of the other cores are doing anything to the value and the test and set completes atomically. Which means that every time you do this, it slows down all the other cores, and it causes all sorts of effects to the CPU caches.
      Not a big issue when you have just 1 lock and acquire only occasionally, but if you start having fine grained locks everywhere, test-and-set are no longer cheap.

  • @vuhuyngonguyen8618
    @vuhuyngonguyen8618 7 років тому +1

    Seem the slides was removed in dropbox , If any guy have links to download it ??

  • @workflowinmind
    @workflowinmind 7 років тому +4

    44:35

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

    that reminded me of my faulty multithreaded code

  • @kitsonamane1733
    @kitsonamane1733 7 років тому +7

    Slides link returns "File not found". Help !!!

    • @CrafterLuke
      @CrafterLuke 7 років тому

      someone killed the thread right as it was uploading :(

    • @kitsonamane1733
      @kitsonamane1733 7 років тому +1

      hahaha they must have encapsulated that thread in a daemon threadkiller because every time I try i it fails

    • @SFPython
      @SFPython  7 років тому +3

      Dropbox public links died. Moved to pybay.com/site_media/slides/raymond2017-keynote/index.html

    • @kitsonamane1733
      @kitsonamane1733 7 років тому

      Thanks the link works fine now

  • @ruslansmirnov9006
    @ruslansmirnov9006 6 років тому

    The interesting part starts somewhere around 45:00.

  • @FreedomIsNeverEverFree
    @FreedomIsNeverEverFree 5 років тому

    it hangs.. means 卡了?

  • @theavo
    @theavo 5 років тому

    Does anyone know how to create html files with keynotes just like the ones used by Raymond?

    • @amhokies
      @amhokies 5 років тому +2

      I think it's generated using Sphinx Read The Docs Theme

    • @theavo
      @theavo 5 років тому

      @@amhokies thanks! :)

  • @ankile
    @ankile 4 роки тому

    Seeing him cough now in corona times was surprisingly painful..

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

    I don't know if I'm just not getting something or the video just didn't age well... but his arguments against threading don't seem correct. Threading has been done for a looooong time. It may causes bugs? Yes, but normal code may too. Testing will never cover all bugs indeed (as he says about the race conditions) but this is true to normal non-threading code too! So should we abandon code at all because of the possibility of messing up????
    One of his points in 16:00 is that if threading doesn't have a race condition then you probably wouldn't need threads at all... This is so wrong! Any experienced back-end developer already came up with situations were he needed to implement a lock to avoid a race condition and situations were this simply isn't needed (eg, if I need to populate an object were each part of the object doesn't depend on the others and the order of insertion doesn't matter then multi-threading is absolutely safe! In a game, for example, the rendering of trees is independent of the rendering of animals or other characters, if you used to play MMOs more than 15 years ago with slow PC's and internet connection you know what i'm talking about).
    Furthermore many new languages have found ways to share state (with the programmer being in charge of the security of memory and data) between "threads". Golang has goroutines, Rust has its thread and scope system, Erlang has its processes inside the JVM, even modern C++ had found a way to make the code easier to detect race conditions although about this one I've only heard of. For what I know many languages have found ways to deal with the threads problem in safer and lighter ways, this panic is unnecessary.

  • @sucim
    @sucim 5 років тому +7

    He looks rather like a protoype Siemens CEO than like a nerd :D

    • @peternau1346
      @peternau1346 4 роки тому

      Aber sein amerikanischer Akzent verrät ihn.
      (But his American accent gives him away.)

  • @joemeissler4876
    @joemeissler4876 7 років тому

    Slides url isn't working any longer, fyi

  • @danielschmider5069
    @danielschmider5069 5 років тому +2

    Oh god the joke at 46:38 did not age well

    • @narnbrez
      @narnbrez 5 років тому +1

      could have been something he heard on the grapevine honestly

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

    There are those who believe that if you mix threading and forking that you are living in a state of sin and deserve whatever happens to you.

  • @sarahpurkrabek2437
    @sarahpurkrabek2437 6 років тому +1

    slides are a dead link

    • @thehighevolutionary7161
      @thehighevolutionary7161 6 років тому +5

      It's working now.
      pybay.com/site_media/slides/raymond2017-keynote/index.html

  • @armynyus9123
    @armynyus9123 4 роки тому

    Good talk as always but think about it: All that doubling of python internals and skills requirements to learn async for reducing 20% CPU compared to Threads - and around 0% compared to gevent?
    In the beginning he said correctly that loading all local cores is anyway just a niche use case, a step before real distributed computing.
    So think about it: You really want to do all that to you, for 20% gain instead of rather architecting in distributed computing, when threads don't cut it? Or stick with greenlets and keep simple beautiful python code, which does distribution already, w/o you even care when handling sockets or IPCs?
    I rather stick with the latter.

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

    01:11:17 Ahh my eyes.

  • @donha475
    @donha475 5 років тому

    OH WOW! I did not know that if you fail to acquire a lock then you can screw the program! scary!

    • @Mr1995Musicman
      @Mr1995Musicman 5 років тому +1

      To be somewhat pedantic:
      Failing to acquire the lock is only the symptom (called deadlock), it is the failure to *release* a lock that is the root cause that will screw everything up.

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

    hahahha im an unreasonable person

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

    this guy is hilarious

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

    Totally misleading in the way he puts things in perspective. Not a single word on I/O. Confuse Threading and being Statefull. I am outraged.

  • @rednafi
    @rednafi 5 років тому

    Excellent talk but there was a lot of time spent on fucking and unfucking up threading and a not a whole lot of asyncio.

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

    Unreasonable people invent their own programming languages. And all programmers depend on the unreasonable people.

  • @RagHelen
    @RagHelen 6 років тому +10

    If you marry nine wifes, you can have a baby every month.

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

    python == noob;

  • @SusanAmberBruce
    @SusanAmberBruce 6 років тому

    So boring

  • @nickolasnielson4727
    @nickolasnielson4727 4 роки тому

    He looks rather like a protoype Siemens CEO than like a nerd :D