File size: 237 Bytes
114194d
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from __future__ import annotations

import concurrent.futures
import os

_MAX_WORKERS = min(32, (os.cpu_count() or 1) + 4)

thread_pool = concurrent.futures.ThreadPoolExecutor(
    max_workers=_MAX_WORKERS, thread_name_prefix="shared"
)