突然觉得写博客是个好习惯 踩过的坑都不能忘了。。
1.首先 C++创建多线程的几种方式:
C++多线程之_beginthread
https://blog.csdn.net/u013043408/article/details/83830181
C++多线程之CreateThread
https://blog.csdn.net/u013043408/article/details/83830598
C++多线程之std::thread
https://blog.csdn.net/u013043408/article/details/838555651
std::thread是C++11中新支持的多线程库,常见的创建线程、join、detach都能支持。
2.在网络模块,之前一直使用_beginthread的方式创建新线程,没有出现过问题。昨天说试一下std::thread中的thread类。
#include <thread>
仅仅是包含了thread头文件后,socket就接收不到数据了。