What Are The Advantages Of Concurrent.futures Over Multiprocessing In Python?
I'm writing an app in Python and I need to run some tasks simultaneously. The module multiprocessing offers the class Process and the concurrent.futures module has the class Proces
Solution 1:
The motivations for concurrent.futures are covered in the PEP.
In my practical experience concurrent.futures provides a more convenient programming model for long-running task submission and monitoring situations. A program I recently wrote using concurrent.futures involved monitoring a directory for incoming files over a 2-3 hour window, translating each file as it arrives to a task, submitting it and so on. Future objects returned by the ProcessPoolExecutor allow for tracking task status, providing intermediate status reports etc in a convenient way.
Post a Comment for "What Are The Advantages Of Concurrent.futures Over Multiprocessing In Python?"