5,321
edits
Line 336: | Line 336: | ||
from concurrent.futures import ThreadPoolExecutor | from concurrent.futures import ThreadPoolExecutor | ||
executor = ThreadPoolExecutor(max_workers=len(os.sched_getaffinity(0))) | executor = ThreadPoolExecutor(max_workers=5 * len(os.sched_getaffinity(0))) | ||
def do_something(a, b): | def do_something(a, b): | ||
return a + b | return a + b |