25.C++多线程
2024-09-06 03:02:25
#include <iostream>
#include <thread>
#include <Windows.h>
using namespace std; void run()
{
MessageBoxA(, "", "", );
} void showmsg(const char *str1,const char *str2)
{
MessageBoxA(, str1, str2, );
} void main()
{
////栈上开辟
////并行,异步,非阻塞
//thread t1(run);
//thread t2(run); //thread t[2]{ thread(run),thread(run) }; ////堆上开辟
//thread *pthread(new thread(run)); //多线程传递参数
thread th1(showmsg, "", "");
thread th2(showmsg, "", "");
thread th3(showmsg, "", ""); cin.get();
}
最新文章
- [备忘]检索 COM 类工厂中 CLSID 为 {91493441-5A91-11CF-8700-00AA0060263B} 的组件时失败解决方法
- Node.js入门笔记(2):全局对象(1)
- 【Maven】Eclipse安装Maven插件后导致Eclipse启动出错
- iPad 控件UIPopoverController使用
- SSAS计算列如果是中文名称时,必须要在名字外加中括号
- Apache启用性能优化——启用Gzip,JS压缩
- MVC4.0 利用IActionFilter实现单一Action返回多种结果
- 二、FreeMarker 模版开发指南 第二章 数值和类型
- Windows环境下使用cygwin ndk_r9c编译FFmpeg
- Django form模块使用心得
- Python-String字符串的相关方法
- Why deep learning?
- MySQL慢查询日志释疑总结
- unity 如何在botton AddListen中传递参数调用函数
- HDU.5385.The path(构造)
- UEP-添加
- 【Flask-RESTPlus系列】Part3:请求解析
- Eclipse中快速打开文件所在的文件夹位置
- 【Luogu3803】多项式乘法FFT(FFT)
- 第2课:什么是SQL注入
热门文章
- 洛谷 P1769 淘汰赛制_NOI导刊2010提高(01)
- glEnable(GL_DEPTH_TEST)作用
- ubuntu 下安装eclipse &;amp;java环境配置
- android ViewPager实现 跑马灯切换图片+多种切换动画
- CentOS6 安装 aria2
- vue11 vue实例方法
- DMA在FPGA的应用之我见
- snowflake算法
- 机器学习(三) Jupyter Notebook, numpy和matplotlib的详细使用 (下)
- 网络协议 4 - 交换机与 VLAN