#include #include void* sakana(void* x){ int c=10; while(c--){ usleep(random()%1010); printf("%s\n", "sakana"); } } void* tako(void* x){ int c=10; while(c--){ usleep(random()%1000); printf("%s\n", "tako"); } } main(){ pthread_t thre1, thre2; pthread_create(&thre1, NULL, sakana, NULL); pthread_create(&thre2, NULL, tako, NULL); pthread_join(thre1, NULL); pthread_join(thre2, NULL); }