multithreading - C++ - Passing data between threads -
i have thread pool consists of 4 threads: t1, t2, t3, , t4. running concurrently, input t3 , t4 depends on output t2. how should implement message queue after t2 completes, send output data t3 , t4 processing? have tried implement message queue using locking mechanism, seems locking quite expensive. there lock-free mechanism pass data between threads? using boost::thread in visual studio 2010.
boost has lock-free queue: http://www.boost.org/doc/libs/1_56_0/doc/html/lockfree.html.
Comments
Post a Comment