Reaching a Per-Interpreter GIL
Eric Snow
Python Language Summit
27 April 2022
https://bit.ly/37LMQ6K
https://bit.ly/37LMQ6K
https://bit.ly/37LMQ6K
https://bit.ly/37LMQ6K
Multiple Interpreters in a Process
https://bit.ly/37LMQ6K
commit a027efa5bfa7911b5c4b522b6a0698749a6f2e4a
Author: Guido van Rossum <guido@python.org>
Date: Mon May 5 20:56:21 1997 +0000
Massive changes for separate thread state management.
All per-thread globals are moved into a struct which is manipulated
separately.
https://bit.ly/37LMQ6K
Multiple Interpreters in a Process
https://bit.ly/37LMQ6K
Multiple Interpreters in a Process
https://bit.ly/37LMQ6K
Multiple Interpreters in a Process
https://bit.ly/37LMQ6K
Consolidating Runtime-Global State
https://bit.ly/37LMQ6K
Consolidating Runtime-Global State
https://bit.ly/37LMQ6K
commit 76d5abc8684bac4f2fc7cccfe2cd940923357351
Author: Eric Snow <ericsnowcurrently@gmail.com>
Date: Tue Sep 5 18:26:16 2017 -0700
bpo-30860: Consolidate stateful runtime globals. (#2594)
* group the (stateful) runtime globals into various topical structs
* consolidate the topical structs under a single top-level _PyRuntimeState struct
* add a check-c-globals.py script that helps identify runtime globals
Other globals are excluded (see globals.txt and check-c-globals.py).
https://bit.ly/37LMQ6K
Consolidating Runtime-Global State
https://bit.ly/37LMQ6K
Consolidating Runtime-Global State
https://bit.ly/37LMQ6K
Consolidating Runtime-Global State
https://bit.ly/37LMQ6K
Consolidating Runtime-Global State
https://bit.ly/37LMQ6K
Interpreter Isolation
https://bit.ly/37LMQ6K
Interpreter Isolation
https://bit.ly/37LMQ6K
A Per-Interpreter GIL
https://bit.ly/37LMQ6K
A Per-Interpreter GIL
https://bit.ly/37LMQ6K
A Per-Interpreter GIL
https://bit.ly/37LMQ6K
Reaching a Per-Interpreter GIL
https://bit.ly/37LMQ6K
Biggest Obstacles
https://bit.ly/37LMQ6K
Obstacle: Memory Allocators
https://bit.ly/37LMQ6K
Obstacle: Memory Allocators
https://bit.ly/37LMQ6K
Obstacle: Memory Allocators
https://bit.ly/37LMQ6K
Obstacle: Burden(?) on Extension Module Maintainers
https://bit.ly/37LMQ6K
Obstacle: Objects Exposed by the C-API
https://bit.ly/37LMQ6K
Biggest Obstacles
https://bit.ly/37LMQ6K
Discussion!
https://bit.ly/37LMQ6K
Biggest Obstacles
"Reaching a Per-Interpreter GIL" - Eric Snow - Language Summit - 27 April 2022
https://bit.ly/37LMQ6K
https://bit.ly/37LMQ6K
For the Python community, CPython's multi-core story has been murky, at best, due to the GIL. Since 2014, I've been slowly working on a solution that centers on no longer sharing the GIL between multiple interpreters in the same process. That goal is within reach for the 3.12 release.
In this talk we will look at where things are at, focusing on the biggest remaining obstacles. This includes things like the impact of stable ABI extensions (especially older ones), what to do about the allocators, and dealing with objects exposed by the C-API. Your expertise and feedback will be invaluable as we work to find the best solutions.
https://bit.ly/37LMQ6K
My multi-core Python project is getting close to completion (of the first phase). There are a number of technical challenges that, while not major, would benefit from feedback from the group. This includes:
That's a lot for 10+20 minutes. Realistically, the presentation will be more like this:
https://bit.ly/37LMQ6K