~/talk

Python vs multiprocessing

Talkat PyCon Russia 2022 · 2022-07-30..07-31· [python, concurrency]
links:none on file
slides:none on file

Python multiprocessing with large payloads uses OS shared_memory to avoid copying but requires explicit lifecycle control; a custom shared_memory wrapper is built that tracks ownership and can leak if not closed. Naive owner flags break when an object is sent to multiple workers; adding a per-block atomic reference counter (via a small C extension / atoms library) prevents premature frees and segmentation faults. Locked-manager dicts are safe but slow under load (tests up to ~800 RPS); atomics restore near-baseline latency.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:29Multiprocessing basics and motivation
  3. 4:38Parallel processing with ProcessPoolExecutor
  4. 6:28Shared memory and its benefits
  5. 7:32Memory leaks with shared memory
  6. 8:54SharedMemoryManager for safety
  7. 10:17Building a SharedMemoryWrapper
  8. 13:51Reference counting challenges
  9. 16:39Atomic operations and synchronization
  10. 21:57Atomic operations in practice
  11. 23:42Performance comparison and results
  12. 24:47Q&A session begins
  13. 25:37Handling process termination
  14. 27:05Signaling memory changes
  15. 28:13Comparison with Ray and alternatives
  16. 29:19GPU context and multiprocessing
  17. 31:28File system vs shared memory
  18. 33:14Shared memory limitations in Python
  19. 34:39Handling large data transfers
  20. 35:21Multiprocessing vs horizontal scaling
  21. 37:07Resource competition in virtual environments
  22. 38:10Atomic operations and memory safety
  23. 39:16Context manager trade-offs
  24. 40:21Comparison with Triton and TF serving
  25. 41:46Memory management in practice
  26. 43:32Code review and potential issues
  27. 44:59Final Q&A and closing
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.