Skip to content

Instantly share code, notes, and snippets.

@duskvirkus
Created May 17, 2022 09:40
Show Gist options
  • Save duskvirkus/89c7672cb2a5f573107422856bc9ede5 to your computer and use it in GitHub Desktop.
Save duskvirkus/89c7672cb2a5f573107422856bc9ede5 to your computer and use it in GitHub Desktop.
import concurrent.futures
from tqdm import tqdm
def run_multiprocess(func, iterator):
with concurrent.futures.ProcessPoolExecutor() as executor:
results = list(tqdm(executor.map(func, iterator), total=len(iterator)))
return results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment