Linux

Jussi Pakkanen: A slightly better ThreadPoolExecutor in Pystd through types

In the previous post we looked at a simple multithreaded task executor that behaves roughly like its Python standard library counterpart. The biggest missing feature was being able to return values from run tasks via future objects. In a fully dynamic language like Python this is fairly straightforward, whereas in a language with static typing, such as C++, things are trickier.The simplest solution is merely to make your Executor class a template, parameterized by the function you want to run.…

Quelle: Originalartikel öffnen

AI Assistant
Context loaded: Jussi Pakkanen: A slightly better ThreadPoolExecutor in Pyst