There are several thread pools in the operating system after Win2k, WorkItemFunc, etc. (see MSDN). I am not introducing them here. I now use a thread pool, mainly the efficiency consideration. Before I have already realized the thread pool, it is only that, there is no finishing. On the other hand, the project is generally very large, and it is not suitable for everyone as an example. I have realized a thread pool here, mainly what I also want to stabilize my thoughts. Principle: key technology multi-thread, event / synchronization, callback mechanism. Detail. Bool cthreaddlg :: OnItDialog () {cdialog :: OnItDialog (); m_threadpool.setpf (TEST); m_threadpool.run (); return true; // Return true unless} you set the focus to a control}
The source code can be obtained at http://www.vczx.com/Article/show.php?id=435.
The latest version is safer, the code is more perfect. However, here I don't know how to upload the source program.
Herce, there is no time to communicate.