Linux

Jussi Pakkanen: Implementing a simple version of ThreadPoolExecutor in Pystd

One of my favourite things in the Python standard library is the ThreadPoolExecutor. It is a very simple way to run a bunch of tasks in parallel, such as converting or repacking a whole bunch of image files from one format to another. You write a pure function that takes two arguments, the input and output file names, and does the conversion. Then you submit a bunch of tasks (basically function and argument pairs) and the executor runs them with…

Quelle: Originalartikel öffnen

AI Assistant
Context loaded: Jussi Pakkanen: Implementing a simple version of ThreadPoolE