~/talk

Introducing Immortal Objects: Building Block Towards a Multi-core Python Runtime

Talkat PyOhio 2024 · 2024-07-27..07-28· [python, concurrency]
links:none on file
slides:none on file

Explains PEP 683’s concrete change: marking a small set of long-lived objects as immortal by setting a magic refcount 4294967295 (low 32 bits on 64-bit), changing Py_INCREF/Py_DECREF and related APIs to no-op for those objects and stopping runtime mutations of the GC header. Demonstrates edits against CPython 3.12 sources, shows why this avoids CAS-induced cache invalidation, data races and copy‑on‑write growth (Instagram’s memory profile case), and notes immortal objects are reclaimed only at finalization.

AI-written summary · about

  1. 0:00Immortal objects in Python
  2. 1:12Python objects and memory basics
  3. 4:31Reference counting and GC
  4. 9:56Object lifecycle and mutability
  5. 13:46Immutable objects aren't truly
  6. 15:56PEP 683 immortal objects
  7. 19:38Motivations for multicore Python
  8. 22:06CPU cache invalidation and races
  9. 24:38Avoiding copy-on-write
  10. 27:27Memory usage impact
  11. 28:55PEP 683 specification details
  12. 30:21Conclusion and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.