3 ms·
OK, let's put it like this: In some contexts, but not all, Python supports a useful amount of parallelism. I have definitely worked on Python projects in the p
by quietbritishjim 5y ago
OK, let's put it like this: In some contexts, but not all, Python supports a useful amount of parallelism.
I have definitely worked on Python projects in the past that were easily parallisable and worked absoluately fine. I simply created threads with threading.Thread, passed messages around with queue.Queue and used some standard Python modules to process those messages. The messages were independent enough from each other that I didn't have any issues with marshalling access to them, while being large enough that the overhead of mulithreading was still outweighed by its benefits. Rewriting the whole thing in C++ (etc.) would have made negligable difference to performance.
I can certainly imagine a program similar to what you describe, where there are lots of messages that operate on a single monolythic data structure, which couldn't easily be made to work with true parallelisation in Python.