Condition variable is a mechanism to implement producer/consumer idiom.
Producer will put data/job into a queue.
Consumer will deque the queue and work on that data.
Usually you should have one producer thread and multiple consumer threads.
In your case one data preparation thread and multiple data processing threads.
I haven't worked much on boost but looks like you haven't implement the data_prepartaion_thread right.
Because this logic [ICODE] while(int_vector.size() != 10)[/ICODE] shouldn't full fill unless all of your consumer threads are busy and your queue is over flown (which still can happened on the busy server, but i have a feeling that wasn't your intention, i think you wanted to enter 10 jobs)
[QUOTE]The condition variable would only awake the data_processing_thread if and only if the condition_variable is waiting for the signal already
That means if none of the data processing threads were on the conditional wait, then signal might get loss.
But its very easy to fix. because your data_processing_thread shouldn't sleep/wait on condition variable if there is already data/job available to process.
So before it goes to sleep, it should check if there is any data available in the queue. If there is data, then no point of sleeping, lets process those. if there is no data, then lets sleep, and Producer_thread/data_preparation thread will signal/broadcast when data is available.
Two advantage of this: 1) It fixes your problem
2)condition variable is expensive (if you are thinking in billions of jobs), it uses mutex( and mutex uses futex ...