#include #include #include #include void * func1(void * arg) { while(1) { sleep(1); printf("%p\n", pthread_self()); } } void * func2(void * arg) { while(1) { sleep(1); printf("\t%p\n", pthread_self()); } } int main(int argc, char**argv) { pthread_t td, td2; pthread_create(&td, NULL, func1, NULL); sleep(10); pthread_create(&td2, NULL, func2, NULL); printf("1st: %p\n2nd: %p\n", td, td2); while(1) { sleep(60); } return 0; }