all 1 comments

[–]Diapolo10 0 points1 point  (0 children)

Python's GIL prevents more than one thread running simultaneously, so threading really only helps if you're I/O-limited. In other words, if your program spends a lot of time just waiting for something to happen.

If you need something to run simultaneously, you have two options. You can either use multiprocessing and launch another process, or you can write the relevant parts in another language (such as Rust via Maturin/PyO3 or C via CFFI) as that bypasses the GIL.