Community
cancel
Showing results for 
Search instead for 
Did you mean: 
nikkey_c
Beginner
137 Views

TBB and QT

Hi i am developing my project (videosurveillanceproject) using TBB for parallelprocessing,and QT for GUI designing. But I could not able to get fast output, but if i use only TBB then i can able to get good output.
So cant QT and TBB work together? is there is any solution for this?
I am using pipelining and concurrent queue for parallel processing.
Pipelining is used for video processing, and concurrent queue is used for store result and those result are displayed in every 30ms by using thread sleep method.
I couldnt able to get actual parallel program after using both.
0 Kudos
4 Replies
Dmitry_Vyukov
Valued Contributor I
137 Views

Sleeping in a GUI thread is not a good idea. You better use something along the lines of timers (I guess QT must have timers). Other than that, the design looks OK. What exactly do you mean by "I couldnt able to get actual parallel program"?
nikkey_c
Beginner
137 Views

"I couldnt able to get actual parallel program"
That means, I code to display image(a frame) for every 50ms (either QT timers or tbb sleep method), but during runtime it shows only some frames but after parallel program finishesit show/ display in every 50ms smoothly.
jimdempseyatthecove
Black Belt
137 Views

What happens when you initialize TBB to use 1 less thread than you have hardware threads? (assuming you have more than two hardware threads).

What happens when you initialize TBB to use all available hardware threads
.AND. raise the priority of the QT threads? (this assumes frame watching is more important than frame processing)

Note, in either case you may have an oversubscription of threads situation. Foroversubscription situations do not use SpinWaiting type of operatons.

Jim Dempsey
ARCH_R_Intel
Employee
137 Views

Chapter 8 of the new TBB Design Patterns manual covers a basic pattern for using TBB with a GUI. It requires the new "task::enqueue" feature. To download the manual, go to http://www.threadingbuildingblocks.org/documentation.php and select the link "Design patterns" under the "Open Source Documentation" heading.

Reply