Skip to content

3.6 Alternatives and Prior Art

Eric Snow edited this page May 31, 2023 · 1 revision
  • Python Features / Modules
  • Python Libraries / Projects
    • Dask
  • Python Implementations
    • Jython
    • IronPython
    • PyPy (STM)
    • skython
  • CPython
    • Gilectomy
    • nogil
    • other attempts to remove the GIL
    • pyparallel
  • Programming Languages
    • Go
    • Rust
    • Elixir
    • Erlang
    • C#
    • Java
    • Lua
    • ...
  • Other
    • better concurrency primitives for threaded programming
    • add multi-core support to the asyncio event loop
    • improve documentation
    • fibers (Windows)
    • other disciplines (esp. conceptual modeling, workflow analysis, etc.)...
    • Knuth...

pyparallel

Dask

STM

nogil

...

Gilectomy

  • Larry Hastings

other attempts to remove the GIL

  • many possible solutions
  • everyone's favorite whipping boy
  • get rid of GIL but only with PYTHON_MAX_CORES set to something higher that 1 (a la Go)...
  • Nick: "Threads aren't the problem, shared memory threading without appropriate access control primitives are the problem. Race conditions, especially around object life cycles, are the bane of both correctness and stability."

better concurrency primitives for threaded programming

  • send tasks atomically between threads/cores/processes? (apparently Go does something along these lines when a goroutine blocks)
  • isolate task resources to just that task
  • make task shared-memory read-only (a la pyparallels)
  • threads/subinterpreters with COW

add multi-core support to the asyncio event loop

...

improve documentation

  • multi-processing and asyncio...
> Would better education/documentation be sufficient?  (I expect not.)
I think Dave Beazley's PyCon talk provided a compelling demonstration as
to why not - those performance numbers were brutal.

It would actually be nice to build a microbenchmark based on that talk
to quantify the problem we'd be aiming to solve.

--Nick

Jython

...

IronPython

...

skython

fibers (Windows)

Go

  • primitives
  • concurrency model/implementation

Elixir

Elixir (aka Erlang that fits your brain) could be worth looking at on
that front. While I think subinterpreters and a hierarchical locking
model should form the technical foundation, that says very little about
what the high level API should look like.

--Nick

Also:

Erlang

If I understand the heritage correctly, I believe Erlang is the origin
of the message passing design I learned in that original C++ job.
"Communicating sequential processes" is the backing domain from computer
science theory.

--Nick