I need to build a system of workers (represented as threads) and (multiple) queues. Individual jobs are waiting in one of the queues and waits for a worker thread to process them. Each worker can process jobs only from some of the queues. No spin-waiting. C/C++, pthreads, standard POSIX.
The problem for me is the "multiple queues" thing. I know how to implement this with a single queue. The workers need to wait on all the queues that they can process (wait for ANY of them).
On Windows I would use WaitForMultipleObjects, but this needs to be multi-platform.
I don't want any particular code for this, only a hint or a description of the model which I should use. Thanks in advance.