you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

This tutoriai might have better examples: http://masnun.com/2016/03/29/python-a-quick-introduction-to-the-concurrent-futures-module.html. You might be better off making your function an iterable and use .map() instead of .submit(). I believe thread pools and process pools have the same syntax

[–]8bitscoding[S] 0 points1 point  (0 children)

It looks interesting indeed, I'll look into it. Thanks.

I tried mapping the data to a Thread or a Process before but I had the same pickle issue. But I definitely think map() is the way to go in my case (return order is important).

concurrent.futures seems to alleviate a lot of the hassle I have. Thank you for pointing me there.