1216
来源:互联网 发布:ibm电池修复软件 编辑:程序博客网 时间:2024/05/21 18:46
#include <stdio.h>
#include <pthread.h>
#include <unistd.h> /*getpid()*/
void *create(void *arg)
{
printf("New thread .... \n");
printf("This thread's id is %u \n", (unsigned int)pthread_self());
printf("The process pid is %d \n",getpid());
return (void *)0;
}
int main(int argc,char *argv[])
{
pthread_t tid;
int error;
printf("Main thread is starting ... \n");
error = pthread_create(&tid, NULL, create, NULL);
if(error)
{
printf("thread is not created ... \n");
return -1;
}
printf("The main process's pid is %d \n",getpid());
sleep(1);
return 0;
}
#include <pthread.h>
#include <unistd.h> /*getpid()*/
void *create(void *arg)
{
printf("New thread .... \n");
printf("This thread's id is %u \n", (unsigned int)pthread_self());
printf("The process pid is %d \n",getpid());
return (void *)0;
}
int main(int argc,char *argv[])
{
pthread_t tid;
int error;
printf("Main thread is starting ... \n");
error = pthread_create(&tid, NULL, create, NULL);
if(error)
{
printf("thread is not created ... \n");
return -1;
}
printf("The main process's pid is %d \n",getpid());
sleep(1);
return 0;
}
0 0
- 1216
- 1216
- 1216
- ZOJ 1216
- ZOJ 1216
- zoj 1216
- 1216_Deck
- ZOJ-1216
- zoj 1216
- ACdream 1216
- hdu 1216
- Lightoj 1216
- hrbust 1216
- hdu 1216
- zoj 1216 Deck
- ZOJ 1216 Deck
- zoj 1216 Deck
- ZOJ 1216 Deck
- swift语言的学习笔记十一(performSelector)
- swift语言的学习笔记十二(willSet与didSet)
- ansj分词方式详细解析
- 在 Linux 上如何清除内存的 Cache、Buffer 和交换空间
- 第十章:内部类(上)
- 1216
- 15 款最好的 C/C++ 编译器和集成开发环境
- C1000k测试服务器支持的tcp连接数
- Factorial Trailing Zeroes
- 图片路径中含有中文在jsp下不能正常显示的问题
- 基于gensim的Doc2Vec简析
- [LeetCode]90. Subsets II
- Node.js的Path对象
- 如何使用Bugly进行热修复