HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

Raymond Hettinger, Keynote on Concurrency, PyBay 2017

SF Python4 HN recommenders · recommended in 4 months, 2018-2023
YouTube
161K views · 9 years ago · talk · evergreen

Raymond Hettinger's PyBay 2017 keynote on concurrency in Python. It covers threads, processes, asyncio, locks and the GIL, with live shell-based examples.

Recommended as a clear, charismatic starting point for understanding Python concurrency and the GIL.

Python, Ruby & scripting languagesSoftware architecture & design#python#gil#threading#asyncio#raymondhettinger

7 comments from Hacker News

@culebron212023 · in “How to use a Python multiprocessing module”

I've just left the question open, but the best learning material for me on this was this lecture. Other points down the list, I had to figure out just by trial and error. Raymond Hettinger, Keynote on Concurrency, PyBay 2017 ▶ this video

Strongly recommendsView on HN
@fastball2021 · in “The GIL and its effects on Python multithreading”

For anyone looking for something on the same topic but a little bit lighter / more practical, I really enjoyed this talk[1] by Raymond Hettinger at PyBay 2017, where he discussed the GIL as well. [1] ▶ this video

RecommendsView on HN
@targafarian2021 · in “Python Concurrency: The Tricky Bits”

To say concurrency is broken in Python because of the GIL seems to be reiterated adage without actual wisdom behind it.[1] Are you writing an IO-bound task? Then asyncio[2] (even if just viewed as an interface: e.g., you can make it even more performant by using uvloop[3]) is a great way to achieve performant concurrency. As Raymond Hettinger likes to point out, even if you throw away the GIL, you will have to implement locks on shared resources (unless you're writing embarrassingly parallel codes--in which case either you can invoke them separately or use the multiprocessing module to great effect, or see how I do it easily below), and by the time you get all the locks implemented in your GIL-less world (locks which are error-prone), you've given up the performance you thought you'd get due to throwing away the GIL. Are you writing a CPU-bound task? I've only encountered this in scientific computing, as I'm a scientist, and for this (as another commenter mentions) I either use numpy[4] (strictly within a numpy call, the GIL is not held) or numba[5] (by default the entirety of your numba-fied functions do not hold the GIL). Therefore, I can either use Python threads or asyncio or Numba's built-in parallelism[6,7] (summary: some numpy routines for working with arrays of values are auto-parallized if called within a numba-fied function, and you can explicitly parallelize your own loops via `for i in numba.prange(N):`; in any case, then decorate the function with `@numba.njit(pa

CitesView on HN
@xkgt2019 · in “Has the Python GIL Been Slain? Subinterpreters in Python 3.8”

It is because only one thread at a time holds the lock in order to avoid race conditions. The keynote[1] by Raymond Hettinger from PyBay '17 will be a great place to start if you are new to this. [1] ▶ this video

RecommendsView on HN
@dangom2018 · in “JupyterCon: I don't like Notebooks [slides]”

Notebooks may be suitable for scratching things, but not much else. The problems noted by the OP are very serious, specially in the scientific world, where many do not have proper software engineering skills. The real issue is that newcomers do not know better, and so they don't realize the damage they're inflicting upon themselves and others before it's too late (irreproducible code, hidden states, dep. management, etc). Even the fast.ai library, which is a wonder, has broken notebooks. For those who try to follow the course at home, trying to run the notebooks is frustrating, as things are out of order and so errors pop up all the time. Jeremy is a wonderful teacher, but compare following a Fast.ai course video, which uses notebooks, to following a python video from, e.g., Raymond Hettinger [2], which uses sphinx and a shell. While the documentation style and ugly shell don't look nearly as cool, they are so much clearer and better structured. Notebooks become popular because they fill one gap that was left uncovered. As the scientific community moves away from Matlab into Python and R, reading code - pushed, amongst others, by the popularity of Github - becomes a day-to-day activity. Matlab scripts were easily explorable because users would load them, set breakpoints here and there, and look at results interactively - exactly what notebooks aim to provide. The difference is that what used to be breakpoints now become cells, comments now turn into Markdown and figures are i

CitesView on HN
@scrollaway2018 · in “Ask HN: What talks or videos do you suggest to watch on a long flight?”

I've started watching Raymond Hettinger's talks lately. He's a core dev on Python. I love them, the guy is charismatic, very smart and his Python knowledge constantly impresses me. link My favourite: ▶ this video

Strongly recommendsView on HN
@devxpy2018 · in “Why Threads Are a Bad Idea (1995) [pdf]”

Threads are not hard. In fact, threads are extremely easy to implement. However, real Threading code is just incredibly difficult to reason, just by looking at it. This makes it easy for you to introduce race conditions without even knowing that there is one! There is also the fact that locks don't lock anything! They are just a flag, that a any code may choose to ignore. They are a not an enforcing tool, just a cooperative one. (More here: ▶ this video ) P.S. I created a library, that makes it easier to write safer multiprocessing code link

CitesView on HN
Understanding the Python GIL46:10

Understanding the Python GIL

David Beazley
127K views • 14 years ago
Nathaniel J. Smith - Trio: Async concurrency for mere mortals - PyCon 201832:17

Nathaniel J. Smith - Trio: Async concurrency for mere mortals - PyCon 2018

PyCon 2018
30K views • 8 years ago
Build Your Own Async2:12:42

Build Your Own Async

David Beazley
60K views • 7 years ago
Keynote - Preventing, Finding, and Fixing Bugs On a Time Budget | Raymond Hettinger @ PyBay201840:01

Keynote - Preventing, Finding, and Fixing Bugs On a Time Budget | Raymond Hettinger @ PyBay2018

SF Python
27K views • 8 years ago
Parallelism, Concurrency, and Asynchrony in Perl 6 / Jonathan Worthington58:08

Parallelism, Concurrency, and Asynchrony in Perl 6 / Jonathan Worthington

yapcasia
6K views • 11 years ago
Google I/O 2012 - Go Concurrency Patterns51:27

Google I/O 2012 - Go Concurrency Patterns

Google for Developers
894K views • 14 years ago
The Mental Game of Python - Raymond Hettinger1:10:00

The Mental Game of Python - Raymond Hettinger

SF Python
131K views • 7 years ago
Larry Hastings - Removing Python's GIL: The Gilectomy - PyCon 201632:07

Larry Hastings - Removing Python's GIL: The Gilectomy - PyCon 2016

PyCon 2016
49K views • 10 years ago
Modern Dictionaries by Raymond Hettinger1:07:41

Modern Dictionaries by Raymond Hettinger

SF Python
150K views • 9 years ago
Concurrency is not Parallelism by Rob Pike31:23

Concurrency is not Parallelism by Rob Pike

gnbitcom
191K views • 11 years ago
Let's #TalkConcurrency Panel Discussion with Sir Tony Hoare, Joe Armstrong, and Carl Hewitt1:06:45

Let's #TalkConcurrency Panel Discussion with Sir Tony Hoare, Joe Armstrong, and Carl Hewitt

Erlang Solutions
13K views • 7 years ago
Raymond Hettinger - Dataclasses:  The code generator to end all code generators - PyCon 201845:08

Raymond Hettinger - Dataclasses: The code generator to end all code generators - PyCon 2018

PyCon 2018
130K views • 8 years ago
Cory Benfield - Building Protocol Libraries The Right Way - PyCon 201631:38

Cory Benfield - Building Protocol Libraries The Right Way - PyCon 2016

PyCon 2016
15K views • 10 years ago
Clojure Concurrency - Rich Hickey2:32:39

Clojure Concurrency - Rich Hickey

ClojureTV
73K views • 13 years ago
Keynote: Begin...End?57:05

Keynote: Begin...End?

David Beazley
9K views • 5 years ago
Dmitry Vyukov — Go scheduler: Implementing language with lightweight concurrency1:00:40

Dmitry Vyukov — Go scheduler: Implementing language with lightweight concurrency

Hydra
47K views • 7 years ago
Shared memory parallelism in Julia | Kiran Pamnany | Cambridge Julia Meetup (May 2018)26:34

Shared memory parallelism in Julia | Kiran Pamnany | Cambridge Julia Meetup (May 2018)

The Julia Programming Language
7K views • 8 years ago
Solid Ground // Saša Jurić35:15

Solid Ground // Saša Jurić

EMPEX Conference
14K views • 9 years ago
User-level threads....... with threads. - Paul Turner - Google34:00

User-level threads....... with threads. - Paul Turner - Google

Linux Plumbers Conference
41K views • 13 years ago
A Talk Near the Future of Python (a.k.a., Dave live-codes a WebAssembly Interpreter)1:01:45

A Talk Near the Future of Python (a.k.a., Dave live-codes a WebAssembly Interpreter)

David Beazley
26K views • 7 years ago