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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -