I am new to multi threading and am following "Advanced programming in unix environment". I am not able to get the order in which the threads are executed. I have the following code.
int err1 = pthread_create(&first, NULL, disp, a);
int err2 = pthread_create(&second, NULL, disp, b);
int err3 = pthread_create(&third, NULL, disp, c);
But the thread related to third tid is executing first, then the second and finally the first. Not sure if this is the behavior or something going wrong.
Thx! Rahul.