摘要: /*exit_join_id.c*/#include#includevoid* eji(void* agr){ printf("here is eji\n"); printf("PID= %u",(unsigned int)pthread_self()); pthread_ex... 阅读全文
posted @ 2014-08-12 20:34 bzyzhang 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 使用gcc,出现如下错误: thread_join.c:7:5: error: ‘for’ loop initial declarations are only allowed in C99 mode for (int i = 0; i < 2; ++i) ^ thread_... 阅读全文
posted @ 2014-08-12 20:04 bzyzhang 阅读(351) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#includestruct member{ int a; char* s;};/*线程1,不传递参数 */void* create1(void* arg){ printf("thread create1 \n"); retur... 阅读全文
posted @ 2014-08-12 19:05 bzyzhang 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 多线程:线程(thread)技术早在60年代就被提出,但真正应用多线程到操作系统中去,是在80年代中期,solaris是这方面的佼佼者。传统的Unix也支持线程的概念,但是在一个进程(process)中只允许有一个线程,这样多线程就意味着多进程。现在,多线程技术已经被许多操作系统所支持,包括Wi... 阅读全文
posted @ 2014-08-12 15:35 bzyzhang 阅读(115) 评论(0) 推荐(0) 编辑