Hey all,
I have the following scenario: I have a single thread that is supposed to fill a container with pairs of integers (in essence, task descriptions), and I have a large number of worker threads (8-16) that should take elements from this container and perform some work.
I thought the problem could be easily solved by a blocking queue -- e.g. on item-removal, threads synchronize access to the queue, and sleep if there is no data available.
I (perhaps wrongly) assumed that something like this should exist in the STL or in boost, but I was unable to find anything.
Do I actually have to implement that thing myself ? It seems like such a common scenario...