Raymond Hettinger, Keynote on Concurrency, PyBay 2017

  Рет қаралды 150,847

SF Python

7 жыл бұрын

Keynote for pybay.com, 2nd annual Regional Python Conference in SF.
Slides: pybay.com/site_media/slides/raymond2017-keynote/index.html

Пікірлер: 87
@senpos
@senpos 7 жыл бұрын
Oh, i see Raymond Hettinger - i press "Like" :-) Thanks for upload!
@baconsledge
@baconsledge 5 жыл бұрын
Raymond is a pleasure to watch and listen to, and makes Python awesome.
@PhilippeCarphin
@PhilippeCarphin 3 жыл бұрын
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.
@kennys1881
@kennys1881 5 жыл бұрын
I'm a simple man.. I see Raymond Hettinger, I click the video
@simonmasters3295
@simonmasters3295 5 жыл бұрын
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 жыл бұрын
30 yrs of coding! your view of the world must be wonderful!
@willd0g
@willd0g 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.
@nuraortap7881
@nuraortap7881 Ай бұрын
What a wonderful and insightful orator and educator.
@pablo_brianese
@pablo_brianese 3 жыл бұрын
This craziness is how I came to understand why functional programming has value.
@XzcutioneR2
@XzcutioneR2 5 жыл бұрын
What an excellent talk. I wish they had let him delve into the detail of that last piece of code.
@KurzedMetal
@KurzedMetal 5 жыл бұрын
Just brilliant!!! He just captured my attention the whole time.
@feddeschaeffer7116
@feddeschaeffer7116 4 жыл бұрын
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?
@DivineZeal
@DivineZeal 5 жыл бұрын
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
@nelsonmacy1010
@nelsonmacy1010 3 жыл бұрын
Great talk. Great teacher. Distills the lesson for good summary.
@mateuszsmendowski2677
@mateuszsmendowski2677 2 жыл бұрын
Best explanation about differences and use cases!
@NeoAF10
@NeoAF10 5 жыл бұрын
This blew away my mind!
@stoneshou
@stoneshou 7 жыл бұрын
there must be a harder way!
@pallenda
@pallenda 7 жыл бұрын
"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?
@vcool
@vcool 6 жыл бұрын
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.
@mujkocka
@mujkocka 4 жыл бұрын
Hope to see you in Montreal again!
@armynyus9123
@armynyus9123 3 жыл бұрын
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.
@alexl2512
@alexl2512 4 ай бұрын
Happened to see this. I learned so much out of it.😮
@Billabongesta
@Billabongesta 4 жыл бұрын
I learned something new!
@Seebergster
@Seebergster 5 жыл бұрын
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
@kw7398
@kw7398 2 жыл бұрын
"How can we make this hard, co we can be paid for it?" quote worth remembering
@ChristophZwerschke
@ChristophZwerschke 6 жыл бұрын
Nice talk. Only at 57:40 it was a bit confusing when you scrolled to the code using locks while still talking about queues.
@morthim
@morthim 3 жыл бұрын
"an electonical computer" woah mr fancy pants with his electricity.
@rewtnode
@rewtnode 7 жыл бұрын
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 6 жыл бұрын
Dropbox changed public links. Moved to pybay.com/site_media/slides/raymond2017-keynote/index.html
@aoeu256
@aoeu256 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.
@vuhuyngonguyen8618
@vuhuyngonguyen8618 6 жыл бұрын
Seem the slides was removed in dropbox , If any guy have links to download it ??
@Phoen1x883
@Phoen1x883 6 жыл бұрын
Link works now.
@fuanka1724
@fuanka1724 6 жыл бұрын
Very interesting talk, too bad asyncio was so lightly covered, very good nonetheless.
@danielschmider5069
@danielschmider5069 4 жыл бұрын
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
@Geza_Molnar_
@Geza_Molnar_ 5 жыл бұрын
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.)
@FreedomIsNeverEverFree
@FreedomIsNeverEverFree 5 жыл бұрын
it hangs.. means 卡了?
@kavorka8855
@kavorka8855 4 жыл бұрын
multiprocessing has nothing to do with "cores", it has something to do with "context switching". With one core, you can have unlimited multiprocessors, only the memory limits this number. What's wonderful about Python is, you don't need to understand the concept, you don't need to be an IT engineer, you can still make programmes, it's the language of the layperson
@MrGarg10may
@MrGarg10may 6 жыл бұрын
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.
@chawza8402
@chawza8402 3 жыл бұрын
where is the guy that share the timestamps?
@jacklong2182
@jacklong2182 3 жыл бұрын
thanks , is this editor vim or emacs
@pessimistic_optimism
@pessimistic_optimism 3 жыл бұрын
that reminded me of my faulty multithreaded code
@theavo
@theavo 5 жыл бұрын
Does anyone know how to create html files with keynotes just like the ones used by Raymond?
@amhokies
@amhokies 5 жыл бұрын
I think it's generated using Sphinx Read The Docs Theme
@theavo
@theavo 5 жыл бұрын
@@amhokies thanks! :)
@ruslansmirnov9006
@ruslansmirnov9006 5 жыл бұрын
The interesting part starts somewhere around 45:00.
@joemeissler4876
@joemeissler4876 6 жыл бұрын
Slides url isn't working any longer, fyi
@Phoen1x883
@Phoen1x883 6 жыл бұрын
Fixed.
@tiagodagostini
@tiagodagostini 4 жыл бұрын
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 жыл бұрын
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.
@kitsonamane1733
@kitsonamane1733 7 жыл бұрын
Slides link returns "File not found". Help !!!
@CrafterLuke
@CrafterLuke 6 жыл бұрын
someone killed the thread right as it was uploading :(
@kitsonamane1733
@kitsonamane1733 6 жыл бұрын
hahaha they must have encapsulated that thread in a daemon threadkiller because every time I try i it fails
@SFPython
@SFPython 6 жыл бұрын
Dropbox public links died. Moved to pybay.com/site_media/slides/raymond2017-keynote/index.html
@kitsonamane1733
@kitsonamane1733 6 жыл бұрын
Thanks the link works fine now
@workflowinmind
@workflowinmind 6 жыл бұрын
44:35
@vasiapatov4544
@vasiapatov4544 5 жыл бұрын
CAHACAHACAA
@ankile
@ankile 3 жыл бұрын
Seeing him cough now in corona times was surprisingly painful..
@louisdegeest3571
@louisdegeest3571 Жыл бұрын
Is there a worse way though?
@sarahpurkrabek2437
@sarahpurkrabek2437 6 жыл бұрын
slides are a dead link
@thehighevolutionary7161
@thehighevolutionary7161 6 жыл бұрын
It's working now. pybay.com/site_media/slides/raymond2017-keynote/index.html
@sucim
@sucim 5 жыл бұрын
He looks rather like a protoype Siemens CEO than like a nerd :D
@peternau1346
@peternau1346 3 жыл бұрын
Aber sein amerikanischer Akzent verrät ihn. (But his American accent gives him away.)
@armynyus9123
@armynyus9123 3 жыл бұрын
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.
@akunnaemeka395
@akunnaemeka395 2 жыл бұрын
this guy is hilarious
@alenpaulvarghese
@alenpaulvarghese 3 жыл бұрын
01:11:17 Ahh my eyes.
@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.
@danielschmider5069
@danielschmider5069 4 жыл бұрын
Oh god the joke at 46:38 did not age well
@narnbrez
@narnbrez 4 жыл бұрын
could have been something he heard on the grapevine honestly
@donha475
@donha475 4 жыл бұрын
OH WOW! I did not know that if you fail to acquire a lock then you can screw the program! scary!
@Mr1995Musicman
@Mr1995Musicman 4 жыл бұрын
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
@lucccar
@lucccar 2 жыл бұрын
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.
@rednafi
@rednafi 4 жыл бұрын
Excellent talk but there was a lot of time spent on fucking and unfucking up threading and a not a whole lot of asyncio.
@RagHelen
@RagHelen 6 жыл бұрын
If you marry nine wifes, you can have a baby every month.
@AbhishekThakur-wl1pl
@AbhishekThakur-wl1pl 4 жыл бұрын
or have all babies at the same month asynchronously.
@HanZhang1994
@HanZhang1994 3 жыл бұрын
Username checks out.
@HypercubeSoftwares
@HypercubeSoftwares 3 жыл бұрын
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.
@junumoon7022
@junumoon7022 3 жыл бұрын
Unreasonable people invent their own programming languages. And all programmers depend on the unreasonable people.
@veruxfps5595
@veruxfps5595 2 жыл бұрын
python == noob;
@peeedurr
@peeedurr 5 жыл бұрын
His "who learned something new" is annoying, as is quite a bit of his style imho.
@JeremyAndersonBoise
@JeremyAndersonBoise 5 жыл бұрын
Peet Morris but did you learn something? Not everyone’s style, but he is a wonderful teacher and software developer.
@aftalavera
@aftalavera 3 жыл бұрын
Let’s talk annoying! Your mask?
@SusanAmberBruce
@SusanAmberBruce 5 жыл бұрын
So boring
@nickolasnielson4727
@nickolasnielson4727 3 жыл бұрын
He looks rather like a protoype Siemens CEO than like a nerd :D
Smart Sigma Kid #funny #sigma #comedy
00:40
CRAZY GREAPA
Рет қаралды 11 МЛН
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 66 МЛН
Хакер взломал компьютер с USB кабеля. Кевин Митник.
0:58
Последний Оплот Безопасности
Рет қаралды 1,7 МЛН
8 Товаров с Алиэкспресс, о которых ты мог и не знать!
49:47
РасПаковка ДваПаковка
Рет қаралды 167 М.