/**sample pthread by ev1lut10n**/ #include #include #include void e(void *arg) { system(arg); } int main() { pthread_t tid_satu, tid_dua; void *tidv1 = "ping google.com"; void *tidv2 = "ping yahoo.com"; if(pthread_create(&tid_satu, NULL, e, tidv1)!=0){ perror("thread creation"); exit(0); } if(pthread_create(&tid_dua, NULL, e, tidv2)!=0){ perror("thread creation"); exit(0); } if(pthread_join(tid_satu, NULL)!=0){ perror("thread join"); exit(0); } if(pthread_join(tid_dua, NULL)!=0){ perror("thread join"); exit(0); } return 0; }