由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - 求助:pthread_create的用法
相关主题
what is the difference between pthread and thr_ ?openMP or boost::thread (pthread) for multithreading ?
multithread programmingQuestions about Makefile
[转载] pthread programming question.如何把提示符变成大写黑体(谢谢)-NULL
Help needed, about pthread...X Window programming
multithread questionRe: redirect in fork() then exec()
pthread_kill SIGINT SIG_DFL multithreadHow to input Chinese under Chinese Version SunOS5.7?(NULL)
Re: what wrong with these thread program. Thanks for helpingHow to creat .tar.gz?
[转载] Pthread Multiprogramming甚至文件权限C之一问
相关话题的讨论汇总
话题: pthread话题: null话题: create话题: serverid话题: thread
进入Unix版参与讨论
1 (共1页)
p******s
发帖数: 938
1
使用pthread_create()出错,以下是测试用的代码:
void *ServerThread(void *arg1)
{
printf("I'm the server\n");
}

int main()
{
pthread_t serverID;
pthread_mutex_init(&lock, NULL);
printf("Now creating the thread to serve..\n");
if(pthread_create(&serverID, NULL, ServerThread, NULL)!=0)
perror("Could not create the thread\n");
pthread_join(serverID, NULL);
exit(0);
}
运行结果:
Now creating the thread to serve..
Could not create the thread
请问是为何出错?//bow
1 (共1页)
进入Unix版参与讨论
相关主题
甚至文件权限C之一问multithread question
Abort(coredump) ??????????????pthread_kill SIGINT SIG_DFL multithread
[转载] how to find IP of current server of UNIX by C language(NULL)Re: what wrong with these thread program. Thanks for helping
Re: [转载] how to find IP of current server of UNIX by C language(NULL[转载] Pthread Multiprogramming
what is the difference between pthread and thr_ ?openMP or boost::thread (pthread) for multithreading ?
multithread programmingQuestions about Makefile
[转载] pthread programming question.如何把提示符变成大写黑体(谢谢)-NULL
Help needed, about pthread...X Window programming
相关话题的讨论汇总
话题: pthread话题: null话题: create话题: serverid话题: thread