线程的创建-5
来源:互联网 发布:java随机生成26个字母 编辑:程序博客网 时间:2024/06/09 23:35
#include <iostream>
#include <thread>
#include <windows.h>
#include <vector>
using namespace std;
using namespace std::this_thread;
void msgA(int num)
{
cout <<get_id()<< " num=" << num << endl;
}
void main()
{
vector<thread *> threads;
for (int i = 0; i < 10;i++)
{
threads.push_back(new thread(msgA, i));//创建一个线程
}
for (auto th: threads)
{
th->join();
}
system("pause");
}
#include <thread>
#include <windows.h>
#include <vector>
using namespace std;
using namespace std::this_thread;
void msgA(int num)
{
cout <<get_id()<< " num=" << num << endl;
}
void main()
{
vector<thread *> threads;
for (int i = 0; i < 10;i++)
{
threads.push_back(new thread(msgA, i));//创建一个线程
}
for (auto th: threads)
{
th->join();
}
system("pause");
}
0 0
- 线程的创建-5
- 线程之线程的创建
- 线程的创建方法
- 创建安全的线程
- 线程的创建
- 线程的创建。。。
- 线程的创建
- 线程的创建
- 线程的创建
- 创建线程的方法
- java线程的创建
- c++线程的创建
- 线程的创建-停止
- 线程的创建
- Java线程的创建
- 线程的创建
- 线程的创建使用
- 线程的创建
- MessageBoxA多线程-2
- 设计模式之工厂模式
- 同步IO和异步IO
- [转载] SBT(Size Balanced Tree)
- TCP三次握手(建立连接)
- 线程的创建-5
- TCP四次握手(关闭连接)
- (十九) Mac 下配置yaf框架
- TCP/IP复习笔记(一)
- SQLite3学习笔记
- java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.type.TypeFactory.constructType
- RDD.glom的用法
- Atitit. Async await 优缺点 异步编程的原理and实现 java c# php
- spring-ioc