当前位置: 技术问答>linux和unix
求linux用户空间多线程编程的例子(最好复杂些)
来源: 互联网 发布时间:2016-05-07
本文导语: 如题 | /*thread_example.c : c multiple thread programming in linux *author : falcon *E-mail : tunzhj03@st.lzu.edu.cn */ #include #include #include #include #define MAX 10 pthread_t thread[2]; pthread_mutex_t mut;...
如题
|
/*thread_example.c : c multiple thread programming in linux
*author : falcon
*E-mail : tunzhj03@st.lzu.edu.cn
*/
#include
#include
#include
#include
#define MAX 10
pthread_t thread[2];
pthread_mutex_t mut;
int number=0, i;
void *thread1()
{
printf ("thread1 : I'm thread 1n");
for (i = 0; i
*author : falcon
*E-mail : tunzhj03@st.lzu.edu.cn
*/
#include
#include
#include
#include
#define MAX 10
pthread_t thread[2];
pthread_mutex_t mut;
int number=0, i;
void *thread1()
{
printf ("thread1 : I'm thread 1n");
for (i = 0; i