Python Concurrency Comparism

As time of writing (2026-08-06) it seems that the experimental freethreading versions of Python (3.13, 3.14 and 3.15) do not work well with the random() call from the random-library. How the test works and has been set up is described in the protocol. The protocol and test-scripts are linked here:

Test scripts

# Script Description View Code Download
1 check_concurrency_pcr.py Pre-generates random numbers before simulation; demonstrates IPC penalty for processes and subinterpreters. View Download
2 check_concurrency_ppcr.py Pre-generates random numbers inside threads/processes/subinterpreters; reduces IPC overhead. View Download
3 check_concurrency_cr.py Calculates random numbers on demand during simulation; the most straightforward approach. View Download
4 check_concurrency_pcr_math.py Based on check_concurrency_pcr.py but uses math.sqrt for C-calls; proves uncritical behaviour. View Download