Subj : why this program can be linked successfully with and without -lpthread To : comp.programming.threads From : Andy Yang Date : Thu Jan 06 2005 12:56 pm Just a simply program. But to my surprise, it can be linked successfully with and without -lpthread option: gcc test.c or gcc test.c -lpthread Both works fine. However, the two linked version show different behavior. I am using Fedore Core 3. Thanks a lot! #include #include #include int main() { int i; pthread_mutex_t mutex; pthread_mutex_init(&mutex, NULL); for (i = 0; i < 1000000; i++) { pthread_mutex_lock(&mutex); pthread_mutex_unlock(&mutex); } pthread_mutex_destroy(&mutex); return 0; } Andy .