Trouble with multiple std::threads and main program execution
I have been struggling for days to come up with a mechanism for launching
a few timers and not having it clock the main program execution.
Combinations of .join() and .detach(), wait_until(), etc
What I have is a vector of std::thread and I want to:
execute the first position
wait for it to finish
execute the next position
wait for it to finish
meanwhile the rest of my app is running along, users clicking things, etc.
Everything I come up with seems to either:
block the main program from running while the timers are going
or
detach from the main thread but then the timers run concurrently, how I
want one after the previous one has finished.
I even posted: C++11 std::threads and waiting for threads to finish but no
resolution that I can seem to make sense of either.
should I be using std::launch::async maybe?
No comments:
Post a Comment