c++11 - c++ 线程detach 问题?
高洛峰
高洛峰 2017-04-17 13:05:39
0
2
700
高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
小葫芦

Because you are not waiting for all threads to finish. The simplest and crudest method is to create 10 threads and save them all, and then have a loop to join them one by one, and finally detach.

If you can use the Windows API, use this (https://msdn.microsoft.com/en-us/library/windows/desktop/ms687028(v=vs.85).aspx).

小葫芦

The program just closed when 5 were printed out

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template