摘要: 多线程服务端 1 /* 2 多线程SERVER 3 */ 4 #include "stdio.h" 5 #include "stdlib.h" 6 #include "strings.h" 7 #include "unistd.h" 8 #include "sys/types.h" 9 #include "sys/socket.h" 10 #include "netinet/in.h" 11 #include "arpa/inet.h" 阅读全文
posted @ 2012-01-29 18:31 MR.YP 阅读(234) 评论(0) 推荐(0)
摘要: 1 /* 2 pthread_create 3 */ 4 #include <stdio.h> 5 #include <pthread.h> 6 #include <stdlib.h> 7 8 9 void *newprintf()10 {11 printf("This is new thread.");12 }13 14 15 void main()16 {17 pthread_t tid;18 pthread_create(&tid, NULL, newprintf, NULL);19 }参数1为指向线程标识符的指针;参数2用 阅读全文
posted @ 2012-01-29 16:43 MR.YP 阅读(167) 评论(0) 推荐(1)