sleep at the main thread by using pthread C/C++ -
Hello, I'm trying to check this program.
This program is working very well, but one thing is this sleep in the main thread? If I change this to less than sleep (2) or puts more work on this * thread.
Thread finish before completing all tasks Is there any better way to wait until the work is finished?
sleep () Suspend the main thread, so work threads are a time After waking up the main thread, this work disables the queue, so in the
wq.control.active the threadfunc () is false, the worker ends the thread But it does not matter that threads end their work.
Comments
Post a Comment