- 1
- 0
- 约2千字
- 约 26页
- 2017-08-23 发布于河南
- 举报
第2章 线程引入N
2.7 线程的引入;Linux中的线程编程;简单多线程程序;int main(void){pthread_t id;int i,ret;ret=pthread_create(id,NULL,(void *) thread,NULL);if(ret!=0){printf (Create pthread error!\n);exit (1);}for(i=0;i3;i++)printf(This is the main process.\n);return (0);}
;我们编译此程序:gcc example1.c -lpthread -o example1运行example1,我们得到如下结果:This is the main process.This is a pthread.This is the main process.This is the main process.This is a pthread.This is a pthread.
;再次运行,我们可能得到如下结果:This is a pthread.This is the main process.This is a pthread.This is the main process.This is a pthread.This is the main proce
您可能关注的文档
- 第1章 C语言概述 大学 免费共享.ppt
- 结构力学PPT 第13章.pdf
- 网易开发和测试笔试题整理.docx
- 第1章 程序设计与C语言(赵津燕).ppt
- 第1章 程序设计与C语言---2.ppt
- 第1章 程序设计与C语言-2July2013.pdf
- 葵花一线分享CAD与PS快捷键.doc
- 第1章_C语言与程序设计概述.ppt
- 第1章对象演化.pdf
- 第1课 祖国心脏.doc
- DBJT_15-176-2020_铝塑模板-技术规范_可搜索.pdf
- DB34_T_3468-2019_民用建筑楼面保温隔声工程技术规程_可搜索.pdf
- 烧伤病区医院感染预防与控制规范DB36_T 2242-2026_可搜索.pdf
- 温室气体 产品碳足迹量化方法与要求 路面工程材料DB31_T 1684-2026_可搜索.pdf
- 租赁居住类农村自建房消防安全管理规范DB31_T 1695-2026_可搜索.pdf
- DBJ∕T 15-84-2011 广东省蒸压陶粒混凝土墙板应用技术规程_可搜索.pdf
- 残膜机械化回收作业技术规范DB15_T 4386-2026_可搜索.pdf
- 98系列建筑标准设计图集-燃气工程_可搜索.pdf
- 村级养老服务站建设与运行管理规范DB15_T 4380-2026_可搜索.pdf
- 城市森林碳汇监测与核算技术规程DB31_T 1232-2026_可搜索.pdf
原创力文档

文档评论(0)