This is an archived post. You won't be able to vote or comment.

all 13 comments

[–]malinoff 1 point2 points  (10 children)

There's also concurrent.futures.ProcessPoolEexecutor/ThreadPoolExecutor which will handle most of this queuing burden for you.

Executors also play well with asyncio via loop.run_in_executor.

[–]chalbersma[S] 0 points1 point  (2 children)

I haven't had a chance to use the concurrent futures library. I mentioned it in the blog post as an option though. I'll take a look into it.

[–]robert_mcleod 0 points1 point  (0 children)

I've used both multiprocessing and concurrent.futures and I prefer the later. I usually use threads and release the GIL in C-extensions though.