Subj : Re: Monitoring multiple sources via one condvar. To : comp.programming.threads From : Markus Elfring Date : Wed Jan 05 2005 08:28 pm > So the actual question is if there exist any common practices to solve > such a problem -- "monitor multiple sources in a consumer", and there > are, where may I read them. Can the following information sources help you? - http://wefts.sourceforge.net/wefts-apidoc-0.99c/classWefts_1_1RingBuffer.htm l - http://www.cs.wustl.edu/~schmidt/ACE-papers.html - http://cabal-net.sourceforge.net/api_doc/ > Perhaps, I should create two different condvars -- but then I don't > understand how to block on both of them at the same time. I think that one approach is the application of separate condition variables for each queue to manage if they are empty, filled or full. How do you think about to use a third variable that combines the signals from the others into a notification for the predicate to continue with a job or task? An other approach would be to register callback functions that perform a notification about a specific condition. Another view is presented in the discussion "Waiting on multiple pthread_cond_t variables". http://groups.google.de/groups?threadm=418A3688.8010503%40hp.com Regards, Markus .