#include #include #include void f(char* s) { int i; printf("Hello from : %s\n", s); fflush(stdout); for (i = 0 ; i < 100000000; i++) { float f = sqrt(i); } printf("Goodbye from : %s\n", s); fflush(stdout); } int main() { pthread_t t1; pthread_t t2; pthread_create(&t1, NULL, (void*) &f, "One"); pthread_create(&t2, NULL, (void*) &f, "Two"); pthread_join(t1, NULL); pthread_join(t2, NULL); }