Subj : Re: Question : usage of conditional variables. To : comp.programming.threads From : David Schwartz Date : Wed Jun 08 2005 10:26 pm "Jamie" wrote in message news:1118276552.328458.251780@g47g2000cwa.googlegroups.com... > Program Summary: > 1) Making two threads (tA, tB) > 2) tA send a conditional signal to tB > 3) tB recv a conditional signal > 4) tB send a conditional signal to tA > 5) tA recv a conditional signal > 6) repeat through 2 to 5. You are thinking about this all wrong. You use pthread_cond_wait to wait for a condition if that condition is not yet ready. You have no condition to wait for. So your code will not do anything sensible. You always wait like this: pthread_mutex_lock(...) while(condition_not_right) pthread_cond_wait(...) do_stuff(); pthread_mutex_unlock(...) DS .