4 ms·
The mess more reflects supporting a programmatic interface to processes in a cross platform manner, coupled with the actual complexity of parallel processing.
by p5a0u9l 3y ago
The mess more reflects supporting a programmatic interface to processes in a cross platform manner, coupled with the actual complexity of parallel processing.
You didn’t mention the recommended high level option for subprocess, ‘subprocess. run’.
- cle 3y agoSure that exists too, but it blocks on process exit. I suppose I can run that in a separate thread but now I've got another dimension of complexity to deal with, and it's unclear if I can stream output from the subprocess? There are other things I didn't mention that get thrown around too such as os.system() and os.fork().
- p5a0u9l 3y agoFor my use cases the asyncio wrapper makes it really easy to stack up a bunch of tasks, let the OS it’s thing, and then collect the results when they’re ready.
- hot_gril 3y agoOther high-level languages do a better job with this.