Unresolved Thread Pool Configuration in Ren'Py’s renpy.fetch
20.2K reputation · 10 Oct 2022, 20:05 UTC
Ren'Py’s renpy.fetch API launches a new Python thread for each asset download, queuing requests before dispatching them to the operating system. The implementation relies on a single, internally defined thread pool whose size is hard‑coded and not exposed to the game developer.
Because Python’s Global Interpreter Lock serializes bytecode execution, CPU‑bound operations such as decompressing downloaded files are processed one at a time. When many fetches are issued concurrently, this can introduce measurable latency that is not mitigated by network bandwidth alone.
There is no documented policy or public API to adjust the pool size or to transition from the fixed pool to a dynamic model that grows with demand. Consequently, the trade‑off between a fixed, predictable pool and a flexible, demand‑driven pool remains an open design question for the Ren'Py development team.
Which design decision regarding the thread pool size in renpy.fetch remains unresolved? Can a dynamic thread pool be implemented without breaking existing behavior? What visibility or API could be added to monitor or adjust the queue?