Subj : Re: thread control by mutex, predicates and conditions puzzle To : comp.programming.threads From : Jomu Date : Fri Jan 07 2005 10:15 am There are signals which will get you out of pthread_cond_wait, probably all (I can't recall any exceptions). Your thread waiting on condition will get EINTR as result of pthread_cond_wait and there you can handle situtation. Of course, signal itself is supposed to be handled in it's handler and after getting EINTR it is up to your thread to lookup state changed by that handler. As for your solution, I think I am a bit too practical to see through all this generalization :). Other elements are looking fine, except this notify_all - you have to pthread_cond_broadcast them all (or rewrite pthread_cond_wait so it marks used conditions at moment - ouch). To register them, you have to use protected list or something similar, and to notify them, you have to lock it, iterate rhtough and broadcast every one. Very intensive variable update operation, IMO :). What is this stop/start action thing? Do you want to freeze your threads only at some points or wherever they happen to be when you stop them? dd .