hi,
i use tbb::pipeline to run stats procesing in parallel
code looks like:
pipeline.add_filter(st1); // pick task day to process
pipeline.add_filter(st2); // actual processing, parallel
pipeline.add_filter(st3); // reduce, seq processing
pipeline.run();
st1 - stage very fast
st2 - really slow, it can take about 1 sec to run on my hardware
st3 - 0.2...0.3 seconds to run
i add debug points to every filter like:
operator()(void*){
mark_enter
calculations
mark_leave
}
to collect timestamps when task executing
in test run was 3 days to process
max 4 tokens to run in pipeline
pentium4 D HT (2 threads)
linux 2.6.18 kernel, debian etch
stats shows:
http://keep4u.ru/imgs/b/080117/96/9620aea591b7dce6b5.jpg
legend:
cals - my 2nd stage
and reduce - 3rd
value 0.2 means stage performed by 2 threads, 0.1 - only one thread.
so i wounder why tbb does not run reduce for 2nd day immediatly after reduce for 1st day is done
it waits until all filters done, and only then picks task to execute
it seems strange to me
is exists any possibility to run stages as soon as previous stage done to maximize CPU usage ?



