Hacker News new | ask | show | jobs
by hot_gril 1005 days ago
Title: "An easy way to concurrency and parallelism with Python"

Content: basically how to use ThreadPoolExecutor

Comment: Concurrency and parallelism aren't easy in Python.

How is this off-topic?

1 comments

It's mostly about communicating with subprocess and Popen, which has little to do with this article, other than being Python modules you can use with concurrent futures. It's also long-winded and beside the point. Shouldn't be the top comment.
Subprocessing is the only way to do full parallelism in Python. The title includes parallelism, and the article says how threading can achieve it specifically if your CPU-bound portion is inside C modules (which release the GIL), but it's relevant to mention how you do parallelism in the general case.
Problems communicating with a crashy subprocess are not what I came to the thread for. Certainly not had issues like that myself.

If you wrote the subprocess, add quality and some communication hooks. If you didn't, get a better one or kill -9 it regularly.