多线程
来源:互联网 发布:淘宝电器以旧换新 编辑:程序博客网 时间:2024/05/16 11:38
多线程:
#include<stdio.h>#include<stdlib.h>#include<windows.h>//创建线程 _beginthread() CreateThread().//内部结束线程:_endthread() ExitThread()、外部结束线程 TerminateThread()//冻结线程:SuspendThread(hd); 解冻线程 ResumeThread(hd);DWORD WINAPI fun(void *p){int i = 1;while (i){printf("%d\n", i++);if (i > 80000){//_endthread();//用于线程内部退出ExitThread(0);//结束线程,线程内部}}return 0;}//主线程,主导作用,管理调用共他线程void main(){//创建线程HANDLE hd = CreateThread(NULL, 0, fun, NULL, 0, NULL);system("pause");SuspendThread(hd);//冻结线程system("pause");ResumeThread(hd);//解冻线程TerminateThread(hd,0);//0:代表编号,外部强行结束线程system("pause");}
0 0
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- 多线程
- NSArray不用遍历能否判断一个对象是否存在在数组里面?
- 20160723 异常/
- 主题模型TopicModel:Unigram、LSA、PLSA主题模型详解
- ubuntu14.04+ROS indigo+kinectV1 骨骼点检测
- Window,WindowManager学习总结
- 多线程
- 中文乱码问题,Eclipse能正常显示,但在tomcat部署工程中不行
- HDU 1532 Drainage Ditches (最大流模板)
- sunday算法和自己关于字符串匹配的一些思考
- struts2表单提交的中文参数后台乱码问题解决
- 模拟实现strcat strncat函数
- Unable to negotiate with legacyhost: no matching key exchange method found.
- 003:Java's +=, -=, *=, /= compound assignment operators
- 文章标题