Threads are created in a loop, and their number is not known in advance.

threads.push_back(boost::thread(readFile, it->path())); 

How to know when all such threads have completed their work?

    1 answer 1

    For example,

     for (auto& t : threads) t.join(); 

    ?

    • Yes thank you. The most interesting thing is that I managed to remove this check from the code while I solved other problems: D - Vitaly
    • @ Vitali: Well, that's good. You are welcome! - VladD