David Beazley - Python Concurrency From the Ground Up: LIVE! - PyCon 2015

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ต.ค. 2024

ความคิดเห็น • 114

  • @hezzytheninja
    @hezzytheninja 9 ปีที่แล้ว +319

    The fact that he walked in and did this demo from scratch while keeping the packed room engaged was incredible.

    • @brefaccion
      @brefaccion 8 ปีที่แล้ว +32

      and without syntax highlighting and completion õ.o

    • @VietVuHunzter
      @VietVuHunzter 6 ปีที่แล้ว +2

      His talk are amazing. I was most impressed with the vault talk. This guy is Tom Hanks on an island, but instead of Wilson, he got Python!

    • @cheaterman49
      @cheaterman49 5 ปีที่แล้ว +4

      @@VietVuHunzter It actually sort of happened to him, he mentioned how he was consulting for a bank or something, and they gave him a laptop with no internet or IDE or any sort of tools, but there was Python and a basic text editor IIRC.

    • @kevindong9672
      @kevindong9672 5 ปีที่แล้ว +2

      @@cheaterman49 th-cam.com/video/RZ4Sn-Y7AP8/w-d-xo.html

    • @kevindong9672
      @kevindong9672 5 ปีที่แล้ว +2

      @@cheaterman49 Actually it's proof discovery in a legal process, patent lawsuit or something

  • @penciltwirler5829
    @penciltwirler5829 4 ปีที่แล้ว +85

    This is a performance by someone who has achieved the highest level of their craft.

    • @stabgan
      @stabgan 3 ปีที่แล้ว +1

      Facts

  • @ChristophZwerschke
    @ChristophZwerschke 9 ปีที่แล้ว +106

    A fantastic, entertaining and highly educational talk. It always bothers me that I can't play the piano and talk at the same time (my wife usually asks me things while I'm playing). But David can even type concurrent Python code in Emacs in Allegro vivace speed and talk about it at the same time. An expert in concurrency in every sense of the word. How enviable!

    • @crimsun7186
      @crimsun7186 9 ปีที่แล้ว

      +Christoph Zwerschke But when you're coding is easier. He's just talking what he's doing on the code, which is not that hard to do.

    • @UniqueOneShot
      @UniqueOneShot 8 ปีที่แล้ว

      +Christoph Zwerschke Practice pair programming and it'll become easier

  • @chmod0644
    @chmod0644 9 ปีที่แล้ว +118

    The Jimi Hendrix of Python

    • @bobocsabin
      @bobocsabin 7 ปีที่แล้ว +1

      Good one ! :))

    • @nareshgb1
      @nareshgb1 5 ปีที่แล้ว

      Hendirx + Robin Williams.

    • @Spoons4Hands
      @Spoons4Hands 3 ปีที่แล้ว +1

      Actually he's more of a Bob Ross of Python I think

  • @phisherPhisher
    @phisherPhisher 9 ปีที่แล้ว +48

    his ability to explain his actions while programming fast and accurate without any real tool support (not even syntax highlighting) is pretty much amazing.

  • @MrQsam
    @MrQsam 2 หลายเดือนก่อน +2

    watching this after 10years...
    still relevant knowledge!!!

  • @djanthony6662
    @djanthony6662 8 ปีที่แล้ว +42

    This guy is a legend.

  • @KevinJingQiu
    @KevinJingQiu 9 ปีที่แล้ว +25

    Probably my all-time favourite conference talk :)

  • @Roycocup
    @Roycocup 3 ปีที่แล้ว +6

    This presentation is legendary. Not only is David extraordinarily savvy on the inner workings of Python, but also I doubt that anybody can write code and present ideas AT THE SAME TIME! Sourcery!

  • @SaiJeevan4
    @SaiJeevan4 2 ปีที่แล้ว +1

    dang.. I keep coming here every now and then ..such a brilliant talk !

  • @danielstromberg
    @danielstromberg 9 ปีที่แล้ว +8

    Using coroutines in this way is an example of "cooperative multitasking"; if all your code yields the processor when it should, it can work quite well, but a single uncooperative code element can make a mess of things.

  • @solomonxie5157
    @solomonxie5157 5 ปีที่แล้ว +12

    "You know, every great talk, is started with Socket Programming."

  • @luckyboy20021
    @luckyboy20021 6 ปีที่แล้ว +3

    A lot of wisdom here, to me, it take 3 times watching this to understand the fully concept of concurrency, nice presentation with useful practice, thank a lot.

  • @Mindoza94
    @Mindoza94 ปีที่แล้ว

    This speech is actual even for today! The best explanation of async programming it Python I've ever seen

  • @gaatutube
    @gaatutube 4 ปีที่แล้ว +4

    I would probably have to watch this 20 times over to really understand most (if not all) of his demo. It's like watching a Ninja hack away at the keyboard.

  • @djl3009
    @djl3009 2 ปีที่แล้ว +1

    Thank you! This brilliant talk/live-code-session finally answered all my unanswered questions about concurrency and coroutines in Python. This is absolutely the most legendary live coding with concurrent explanation, I've ever seen.

  • @cenntraru
    @cenntraru 5 ปีที่แล้ว +4

    This talk made me move from Python to Golang. Thank you David! 🙂

  • @memoriasIT
    @memoriasIT 5 ปีที่แล้ว +3

    Video quality isn't the best, he's writing everything from scratch... But that doesn't even matter!
    His explanations are great and has the perfect balance between humor and educational.
    One of the best talks I've ever seen for real.

  • @shanee7511
    @shanee7511 6 ปีที่แล้ว +1

    David Beasley's videos always make ideas so much clearer for me. Such a great teacher!

  • @mtp1376
    @mtp1376 2 ปีที่แล้ว

    PyCon 2015, where I actually first learned coding in Python and started loving it!

  • @FullMetal-nu8bj
    @FullMetal-nu8bj 9 ปีที่แล้ว +3

    This is so interesting, David is informative and hilarious at the same time. I didn't know python supports threading in this way! Awesome!

  • @kapucko1
    @kapucko1 8 ปีที่แล้ว +3

    the best talk I've seen so far

  • @asdfasdfasdf383
    @asdfasdfasdf383 2 ปีที่แล้ว +2

    This is a phenomenal performance. I learned a lot

  • @goshinbi44
    @goshinbi44 9 ปีที่แล้ว +32

    I think he might actually be one of those mythical 10x developers lol.

    • @muntoonxt
      @muntoonxt 5 ปีที่แล้ว +10

      I think that's a ridiculous myth -- that the 10x developer is a myth.
      Every field has people that are incompetent, people that are average, and people that are exceptional.
      The average people do important work. But exceptional folks are capable of generating solutions that are simply 10x better than what an "average person" would ever have come up with.

  • @joseville
    @joseville 3 ปีที่แล้ว +2

    27:06, i've never seen a list (albeit empty) on the left side of an assigment statement. What does it do? The simpler `[] = 1` throws `TypeError: 'int' object is not iterable`. Oh ok, 42:17, it was a bug/typo, but somehow it still worked.
    Btw, awesome talk. He's a great speaker.

  • @taiminyang4236
    @taiminyang4236 4 ปีที่แล้ว

    Amazing, the best and smoothest live coding demo I have ever seen!

  • @landwarrior348
    @landwarrior348 6 ปีที่แล้ว +3

    David is Mozart of Python world.

  • @HimothyOHooligan
    @HimothyOHooligan 9 ปีที่แล้ว +3

    Probably should've gained up the audio a bit. I have my volume maxed out to be able to hear him at a nominal level.

  • @FlavioCoelhoC
    @FlavioCoelhoC 9 ปีที่แล้ว +3

    Amazing talk. for pythonistas, of course...

  • @narayanbala995
    @narayanbala995 2 ปีที่แล้ว +4

    Commenting a bit late. Agree that this is a spectacular talk. Has anybody tried the multithreading code - the first example? I can never get 2 clients working at the same time. The server responds to only one client.

  • @terminalrecluse
    @terminalrecluse 3 ปีที่แล้ว

    Dave is one of the best presenters of all time

  • @birrafondaio
    @birrafondaio 9 ปีที่แล้ว +2

    Values unpacking works on lists as well:
    >>> def returns_a_list_of_lists():
    >>> return 1, [2, 3, 4], [5, 6, 7]
    >>> a, [b, c, d], [e, f, g] = returns_a_list_of_lists()
    >>> a == 1
    True
    >>> g == 7
    True
    The third and last argument must have been an empty list.

  • @chaoticguud
    @chaoticguud 4 ปีที่แล้ว +2

    If you are trying to code along and are getting socket already in use when you are submitting a job to the process pool, put fib_server(('', 25000)) in server.py in a `if __name__ == '__main__'`

    • @watercollector
      @watercollector 3 ปีที่แล้ว +1

      Thanks a lot! I just got this error and deliberately searched in the comments if somebody already published the answer. Thanks!

  • @rockapedra1130
    @rockapedra1130 3 ปีที่แล้ว

    Super simple and well explained! Excellent presentation!

  • @aziz9488
    @aziz9488 9 ปีที่แล้ว

    Great talk, well that's what I call an experienced python programmer!

  • @JuanPabloReyesSepulveda
    @JuanPabloReyesSepulveda 9 ปีที่แล้ว +9

    Awesome Talk. Impressive.

  • @danielstromberg
    @danielstromberg 9 ปีที่แล้ว +2

    yield from was introduced in CPython 3.3.

  • @bbruvey
    @bbruvey 8 ปีที่แล้ว +16

    stackoverflow.com/questions/30147165/why-does-assigning-to-an-empty-list-e-g-raise-no-error if you want to know why 42:30 works

  • @randixlai9216
    @randixlai9216 6 ปีที่แล้ว

    The only thing I learn from the video is he's legend.

  • @antonkot6250
    @antonkot6250 3 ปีที่แล้ว

    7 years ago, omg. now it's mainsteam anywhere. NodeJS, Kotlin, Spring Reactor

  • @aaronhall8039
    @aaronhall8039 9 ปีที่แล้ว +11

    At 6:16, I'm wondering what he wrote there, where it is blocked by the inner video frame.

    • @ashwch
      @ashwch 9 ปีที่แล้ว +24

      Aaron Hall Its Thread(target=fib_handler, args=(client,), daemon=True).start() :P
      github.com/dabeaz/concurrencylive/blob/master/server.py

    • @aaronhall8039
      @aaronhall8039 9 ปีที่แล้ว +7

      Ashwini Chaudhary I just realized I never thanked you. Thanks. :D

    • @dukiwave
      @dukiwave 7 ปีที่แล้ว

      God bless you, man

  • @yomajo
    @yomajo 2 ปีที่แล้ว

    Zero experience in sockets and concurrency in Python. I could not even come up with threaded performance monitor let alone all tne rest. Incredible.

  • @bunc11
    @bunc11 8 ปีที่แล้ว +10

    GODLIKE!!!!

  • @ruipeng5515
    @ruipeng5515 5 ปีที่แล้ว

    Great Talk! Learned a lot from it!

  • @kodampradeep
    @kodampradeep 6 ปีที่แล้ว +2

    I had to watch twice to understand what he is typing and telling at the same time. Lol . How can we become like him :-(

  • @kukas1043
    @kukas1043 ปีที่แล้ว

    Would it be bad practice (or helpful?) to write fib() as C module which releases the GIL? How much would that add overhead?

  • @Thebarbiturat
    @Thebarbiturat 9 ปีที่แล้ว +2

    No slides at speakerdeck and 404 for github page =(

  • @De4sher
    @De4sher 9 ปีที่แล้ว +1

    turns out even in python 2.7, you can do this: `[] = []`
    BUT `{} = {}` will not work.... says it's a SyntaxError "can't assign to literal". What do you know?

  • @abdelrhmanahmed1378
    @abdelrhmanahmed1378 3 ปีที่แล้ว

    your future_wait will grow very fast because we dont clear it i think its better to do this 'def future_done(future):
    tasks.append(future_wait.pop(future))
    future_notify.send(b'x')

  •  7 ปีที่แล้ว +9

    I feel sorry for the 5 people who 👎 this talk.

  • @tetamusha
    @tetamusha 9 ปีที่แล้ว +2

    When I first had to implement a small distributed processing program in Python, I skipped Threads and went right to the multiprocessing package, which actually creates different processes for each object you start. This behavior is much more on par with the behavior of other languages and what is expected from a concurrency perspective. After all, why would you implement concurrent workers if you can't take advantage of more processing power? Might as well do a script that works sequentially.

    • @marcalanstreeter
      @marcalanstreeter 9 ปีที่แล้ว +1

      Douglas De Rizzo Meneghetti Because sometimes what you're doing doesn't require more processing power just more processing time. This especially includes IO work where the processor gets tied up waiting for a response and is doing nothing in the meantime. Now imagine you had to make multiple IO connections each waiting on the other. In cases like these it is better to wait on all concurrently, and that's why it's important to understand the nature of your program. Is it IO bound or CPU bound? There are other tradeoffs to consider and obviously from watching this talk it could be that neither multiprocessing or threads are necessary or desirable in the end.

    • @kevindong9672
      @kevindong9672 8 ปีที่แล้ว +1

      Even with GIL, multi thread is ok for IO-bound tasks.

  • @jmoz
    @jmoz 3 ปีที่แล้ว

    The De Niro & Pacino of Python.

  • @GodefroyClair
    @GodefroyClair 5 หลายเดือนก่อน

    Someone understands why he says ""the load is essentially offloaded somewhere else, you're not fighting with the GIL or anything like that..." 15:48 ? th-cam.com/video/MCs5OvhV9S4/w-d-xo.html
    The GIL is still limiting the task that are sent to the pool of threads right? Where are those task submitted otherwise ?

  • @stoneshou
    @stoneshou 6 ปีที่แล้ว +3

    I'm not sure I've got the point. It was a great talk and I think I've learned something new about threading and async io, but the two problems being presented: 1.performance impact due to the GIL, 2. performance cliff due to python prioritizing CPU intense jobs, was there a hinted solution to any of these problems? Especially for the second problem, all I learned from the video was by combining async io with ProcessPool, we can achieve similar performance cliff as the threading approach. But the performance cliff is still here?

    • @chris8443
      @chris8443 5 ปีที่แล้ว +1

      Right, his point was that there are no easy solutions to those problems and that asyncio doesn't make them go away.

    • @prateemmandal743
      @prateemmandal743 5 ปีที่แล้ว

      I think the take away is that when there is massive number of concurrent tasks, co-routines is the way to go - you can mix in multiprocessing to ensure all cores get used - Posix threads are not going to scale for such requirements.

  • @vrajeshkumar
    @vrajeshkumar 9 ปีที่แล้ว

    Awesome talk!

  • @randyt700
    @randyt700 7 ปีที่แล้ว

    is there a screencast of this available like his talk "built-in super heroes" ?

  • @Water_Soul
    @Water_Soul 6 ปีที่แล้ว

    There David talking about CPU process, but will it works with process which use GPU if we have only one video card and something what take almost all GPU's memory? Or better wrap this process with threading.Lock()?

  • @HelioMeiraLins
    @HelioMeiraLins 2 ปีที่แล้ว +1

    Still not old in 2022.

  • @ashwch
    @ashwch 9 ปีที่แล้ว +6

    Code: github.com/dabeaz/concurrencylive/

    • @filiphron3147
      @filiphron3147 8 ปีที่แล้ว

      +Ashwini Chaudhary Thanks

  • @林玮-k4c
    @林玮-k4c 7 ปีที่แล้ว

    Great talk

  • @b7smart926
    @b7smart926 2 ปีที่แล้ว

    where his writen code could be found

  • @cypherphage4294
    @cypherphage4294 5 ปีที่แล้ว +1

    my mind got destroyed way before that

  • @Mahorir
    @Mahorir 4 ปีที่แล้ว

    Frigging amazing!

  • @lokeshagrawal8240
    @lokeshagrawal8240 5 ปีที่แล้ว +1

    What is the code line written to watch a thread at 6:16?

    • @Alexnotjones
      @Alexnotjones 4 ปีที่แล้ว

      have the same question. it works fine with ... args=(client,)).start()

  • @BGSone
    @BGSone 7 ปีที่แล้ว

    Best talk !!!

  • @medtiw7457
    @medtiw7457 7 ปีที่แล้ว

    Anyone tried this on windows and got some different behavior? (eg: the requests per second didn't drop when I asked the server to compute the fib number of 35 like in: @11:18)

    • @medtiw7457
      @medtiw7457 7 ปีที่แล้ว

      On the other hand the perf1.py test is affected by the computation of the fib number of 35

  • @chenlonglee9511
    @chenlonglee9511 3 ปีที่แล้ว

    where I can download code?

  • @HybridIntuition
    @HybridIntuition 3 ปีที่แล้ว

    Teclado brought me here!!

  • @mehdisaffar
    @mehdisaffar 3 ปีที่แล้ว

    it bothers me when people dont use syntax highlighting..

  • @Spoons4Hands
    @Spoons4Hands 3 ปีที่แล้ว

    this guy pythons!

  • @michaelwu9238
    @michaelwu9238 8 ปีที่แล้ว +1

    nice

  • @eotfofiw2748
    @eotfofiw2748 4 ปีที่แล้ว

    TL;DR; Wouldn't it be good if Python had a concurrency model like Node.

  • @jriggatx
    @jriggatx 9 ปีที่แล้ว

    What he said at 43:46. Thanks!

  • @lsslock4856
    @lsslock4856 7 ปีที่แล้ว

    why not yield future? where from about if what equal future?

  • @FirstNameLastName-fv4eu
    @FirstNameLastName-fv4eu ปีที่แล้ว

    This is called "intellectually"

  • @vishcdac07
    @vishcdac07 6 ปีที่แล้ว

    Tom Hanks!

  • @linan714
    @linan714 9 ปีที่แล้ว

    Amazing talk, I really enjoy it.
    The only problem I have with it is he and the python community pretend NodeJS not exists. Isn't the non-blocking + callbacks the whole idea of nodejs?

    • @zacharynathoo2537
      @zacharynathoo2537 8 ปีที่แล้ว

      node cannot really handle multi core and so is not great, Erlang, go are much better

  • @Acid31337
    @Acid31337 7 ปีที่แล้ว +2

    that's why some switched to go

  • @human-011
    @human-011 3 ปีที่แล้ว +2

    Python docs have very poor asyncio documentation #python_improve_asyncio_docs

  • @mickavelimckenzy3689
    @mickavelimckenzy3689 7 ปีที่แล้ว +3

    oh God! I don't know SHIT in python

  • @rustytrd8245
    @rustytrd8245 7 ปีที่แล้ว +1

    Thanks david for amazing talk. For steps go to:
    github.com/codeAshu/concurrency

  • @bradleyrintoul2644
    @bradleyrintoul2644 7 ปีที่แล้ว

    This is pretty great, but just the fact that threads are still a "hot topic" in Python gives me pause... It's 2016.

  • @stabgan
    @stabgan 3 ปีที่แล้ว

    Too complicated for me

  • @ttrss
    @ttrss ปีที่แล้ว

    goodbye GIL

  • @sindarin1350
    @sindarin1350 7 ปีที่แล้ว

    Can't handle the spit noises arg

  • @artintelligence2682
    @artintelligence2682 6 ปีที่แล้ว

    Down is stupid, even less opened emacs editor. Large font and on the screen 10 lines only visible, constantly scrolls down/top

  • @AlqGo
    @AlqGo 6 ปีที่แล้ว

    Spaghetti code

  • @10monthspregnant
    @10monthspregnant 6 ปีที่แล้ว +2

    This guy is the John Goodman of Python :D

  • @luqmansen
    @luqmansen 6 หลายเดือนก่อน

    Watching this in 2024, amazing talk 🫡👏👏