tirimatangi / Lazy

Light-weight header-only library for parallel function calls and continuations in C++ based on Eric Niebler's talk at CppCon 2019.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Threadpool for "vector in, vector out" mode

tirimatangi opened this issue · comments

Currently every function call is run in a separate thread. The "vector in, vector out"-mode where the same function is run over and over again with different input values might benefit from a threadpool.

Measurements show that an oldish Linux laptop running Ubuntu 20.04 can create 100000 threads per second. So, if the function call executed by the thread takes, say, 1 millisecond, the overhead from thread creation is only about 1%. Hence, the lack of threadpool is not a major issue.

This issue was addressed in branch "thread-pool" which was merged on Nov-3-2020.