Delay std::thread start?

Hello everybody!

I'm writing an app, in which I'm creating an array of std::threads. They start immediately after being created. How to do it, so that they wait for creation of all the threads, so that I can start them all at the same time?

Thanks in advance!
Have the threads wait() on an std::condition_variable, which you notify_all() once all the threads are created.

Why is this a problem, though?
Thank you. It was problem for me as I still have a lot to learn about threading, but I wanted to get this answer quickly.
What I mean is, why is it a problem that the threads don't wait for all their partners to be created? What difference does it make?
I'm just learning a little bit about DoS attacks.
Last edited on
...And? Again, what difference does it make?
I read, that it's better if all threads start sending data at the same time (but now I know it doesn't matter that much, if data is big).
Topic archived. No new replies allowed.