import concurrent.futures with concurrent.futures.ProcessPoolExecutor(max_workers=12) as ppe: def hello(n: int) -> int: if n == 0: return 0 return n+ ppe.submit(hello, n-1).result() future = ppe.submit(hello, 1) print(future.result())