Subj : Re: get num waiters on cv To : comp.programming.threads From : David Schwartz Date : Mon May 02 2005 01:27 pm "Maciej Sobczak" wrote in message news:d55d9u$dat$1@sunnews.cern.ch... >> Is there a way (like say a pthread syscall) to get the number of threads >> waiting on a cv and mutex? > Let's say that there is and you called it and the result was 5. > What does this number mean *after* the syscall returns? If you call it from the only thread that signals the condition variable and you don't use timed waits, then you know that at least that many threads are waiting. For example, it might make sense to have the thread do the work itself if the value is zero rather than signalling the condition variable and then doing something else. DS .