Jim

first commit

For studying purposes
... ...
No preview for this file type
#include <stdio.h>
#include <pthread.h>
int digline[8];
int i;
void* worker1(void* arg){
while(1){
write (1, "11111111", 9);
}
sleep(3);
}
void* worker2(void* arg){
while(1){
write(1, "22222222", 9);
}
sleep(3);
}
int main(){
pthread_t tid1, tid2;
pthread_create(&tid1, NULL, worker1, NULL);
pthread_create(&tid2, NULL, worker2, NULL);
pthread_join (tid1, NULL);
pthread_join (tid2, NULL);
return 0;
}
... ...