Correct way of checking if threads are done?

前端 未结 6 742
一向
一向 2020-12-18 05:10

I\'m using multithreading in my application with _beginthread and right now to wait until all threads are done I have global bools that get set to true as each thread comple

6条回答
  •  一个人的身影
    2020-12-18 05:42

    Windows provides events for one thread to notify another. Out of the box Visual C++ provides support for events only inside MFC. For a portable, non-MFC version, check the thread management classes of the Boost library. They make launching and waiting for threads a lot easier, although they don't provide direct access to all of Windows API's functionality.

提交回复
热议问题