2 years ago

#75963

test-img

gibster

Concurrent.futures ThreadPoolExecutor order

I was wondering whether using multiprocessing via:

with concurrent.futures.ThreadPoolExecutor(max_workers=16) as executor:
    results = executor.map(function, iterable)

preserves the order of the iterable. So if I have iterable = [0,1], the result will be ordered as result = [function(0), function(1)].

If not are there ways to maintain the order, while using a multiprocessing library?

Thanks!

python

python-3.x

multithreading

multiprocessing

0 Answers

Your Answer

Accepted video resources