I'm using TBB combined with Boost.Thread, but I'm not sure I'm using it right. the scenario is as follows:
Our application main's goal is to receive and analyze UDP packets, for that I've used tbb pipeline with several filters (filters
receiving data from the network and filters analyzing the data).
besides that, I have other maintenance and various actions I want to run parallel to the described pipeline, but with lower priority (the pipeline should have the highest priority).
in order to do so I did the following (semi-pseudo code):
boost::thread thr1( boost::bind( &udpPipelineManager::receiveAndHandlePackets, &u1 ) );
boost::thread thr2( boost::bind( &Class1::otherAction1, r1 ) );
boost::thread thr3( boost::bind( &Class2:otherAction2, r2 ) ); ......
thr1 is the thread running the TBB pipeline with many tasks in parallel.
Is this the right way to do it? I have 4 cores, I want the other actions to run on 1 core without distrubing (too much) the pipeline tasks.
**** also, what the threads scheduler policy should be (SCHED_RR, SCHED_FIFO, etc.)?