I have a thread pool consisting of 4 threads: t1, t2, t3 and t4. They work simultaneously, but the input from t3 and t4 depends on the output from t2. How should I implement a message queue so that after t2 completes, it sends the output to t3 and t4 for processing? I tried to implement a message queue using a blocking mechanism, but it seems that blocking is quite expensive. Is there a locking mechanism that transfers data between threads? I am using boost :: thread in visual studio 2010.
source share