exe
来源:互联网 发布:淘宝不能修改宝贝详情 编辑:程序博客网 时间:2024/04/28 15:14
#include <stdio.h>
#include <pthread.h>
void *myThread1(void)
{
int i;
for (i=0; i<100; i++)
{
printf("This is the 1st pthread,created by zieckey.\n");
sleep(1);//Let this thread to sleep 1 second,and then continue to run
}
}
void *myThread2(void)
{
int i;
for (i=0; i<100; i++)
{
printf("This is the 2st pthread,created by zieckey.\n");
sleep(1);
}
}
int main()
{
int i=0, ret=0;
pthread_t id1,id2;
/*创建线程1*/
ret = pthread_create(&id1, NULL, (void*)myThread1, NULL);
if (ret)
{
printf("Create pthread error!\n");
return 1;
}
/*创建线程2*/
ret = pthread_create(&id2, NULL, (void*)myThread2, NULL);
if (ret)
{
printf("Create pthread error!\n");
return 1;
}
// pthread_join(id1, NULL);
//pthread_join(id2, NULL);
return 0;
}
#include <pthread.h>
void *myThread1(void)
{
int i;
for (i=0; i<100; i++)
{
printf("This is the 1st pthread,created by zieckey.\n");
sleep(1);//Let this thread to sleep 1 second,and then continue to run
}
}
void *myThread2(void)
{
int i;
for (i=0; i<100; i++)
{
printf("This is the 2st pthread,created by zieckey.\n");
sleep(1);
}
}
int main()
{
int i=0, ret=0;
pthread_t id1,id2;
/*创建线程1*/
ret = pthread_create(&id1, NULL, (void*)myThread1, NULL);
if (ret)
{
printf("Create pthread error!\n");
return 1;
}
/*创建线程2*/
ret = pthread_create(&id2, NULL, (void*)myThread2, NULL);
if (ret)
{
printf("Create pthread error!\n");
return 1;
}
// pthread_join(id1, NULL);
//pthread_join(id2, NULL);
return 0;
}
0 0
- Exe
- exe
- usrinit.exe,OSE.EXE
- msicuu.exe,msizap.exe
- win32smd.exe、winsmd.exe、vktserv.exe木马病毒
- rsvp.exe,AdskScSrv.exe ,avp.exe
- rundll32.exe
- NTdhcp.exe
- rnathchk.exe
- msiexec.exe
- Issue.exe
- REGEDIT.exe
- cmd.exe
- Cidaemon.exe
- ExERoute.exe
- cabArc.exe
- AL.exe
- Spoolsv.exe
- Matlab写入txt文件
- SPI、I2C、UART三种串行总线协议的区别
- [Leetcode] 9. Palindrome Number 解题报告
- 学习队列的作用 队列的应用--舞伴问题
- 重温JAVA(构造器)
- exe
- knn算法
- 常用的前端框架
- 电压重构(引自孙向东的《三相电压源逆变器输出电压重构技术的研究》)
- Java 8:活好水多——Java 的新IO (nio)
- 为什么循环里的gets()和fgets()在前面有一个scanf时,会跳过第一个的输出
- 什么是堆,栈,内存泄漏和内存溢出?
- WebService学习笔记(四) - SOAP消息格式与处理方式
- Python技术栈/工具整理