Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

PEPs that hit the front page

PEPs that hit the front page

Learn about recent impactful PEPs shaping Python's future

Abdur-Rahmaan Janhangeer

February 25, 2024
Tweet

More Decks by Abdur-Rahmaan Janhangeer

Other Decks in Education

Transcript

  1. mutex only one thread executing python: on mutex / lock

    for threads GIL -> Allows values to be changed safely Prevents multi-core support 12
  2. Have many interpreters Sub interpreters Each one has a GIL

    Each thread runs interpreter with own GIL Work on PEP 554 – Multiple Interpreters in the Stdlib -- makes sense in context of this pep 14
  3. Sam gross: Fb engineer Changes to internals Not much change

    to C API GIL optional, diabled by default: https://github.com/colesbury/nogil Allows parallelizing well up to the number of available cores Replaces CPython's allocator with https://github.com/microsoft/mimalloc helps GPU-heavy workloads 16
  4. More than a POC In the Dose-3D project, the key

    challenge was to maintain a stable, non-trivial concurrent communication link with hardware units while utilizing a 1 Gbit/s UDP/IP connection to the maximum. Naturally, we started with the multiprocessing package, but at some point, it became clear that most CPU time was consumed by the data transfers between the data processing stages, not by data processing itself. The CPython multithreading implementation based on GIL was a dead end too. When we found out about the “nogil” fork of Python it took a single person less than half a working day to adjust the codebase to use this fork and the results were astonishing. 17
  5. Interesting Open PEPs PEP 738 – Adding Android as a

    supported platform PEP 730 – Adding iOS as a supported platform 22