Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

TBB and QT

nikkey_c
Beginner
439 Views
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
440 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
440 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
440 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
440 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