Python には 3 つの並行処理モデルがあり、正しく選ぶには主に処理が I/O バウンドか CPU バウンドかによります。この判断は GIL(スレッドが Python コードを並列実行するのを妨げる)に大きく左右されます。
3 つのモデル
threading → multiple threads, ONE process. GIL-limited for CPU.
multiprocessing → multiple PROCESSES, each its own interpreter/GIL → true parallelism.
asyncio → single thread, cooperative coroutines yielding at await points.
threading — I/O バウンドの並行処理向け
concurrent.futures ThreadPoolExecutor
ThreadPoolExecutor(max_workers=) ex:
results = (ex.(download_url, urls))
