Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
uj
Total Points:
1,350
Status Points:
0
Brown Belt
June 5, 2009 12:24 AM PDT
Qt
Nokia has acquired Qt and open sourced it. Nokia is a big mobile phone maker and Qt is a C++ portable-GUI package.

http://www.qtsoftware.com/

Are there any known issues or problems using TBB with Qt?

Thank you.
Robert Reed (Intel)
Total Points:
9,051
Status Points:
8,551
Brown Belt
June 5, 2009 4:08 PM PDT
Rate
 
#1
Quoting - uj
Nokia has acquired Qt and open sourced it. Nokia is a big mobile phone maker and Qt is a C++ portable-GUI package.

http://www.qtsoftware.com/

Are there any known issues or problems using TBB with Qt?

I know of companies that have successfully employed both libraries in an application but combining them should be done with care.  In a case I'm thinking of, adding Qt shifted resource use around sufficiently to cause substantial contention on a heretofore lightly contended lock, requiring a bit of redesign to avoid that condition.  But keeping TBB out of the line of fire of the event interface should be a good start towards making them play nice together.

uj
Total Points:
1,350
Status Points:
0
Brown Belt
June 12, 2009 4:01 AM PDT
Rate
 
#2 Reply to #1

I know of companies that have successfully employed both libraries in an application but combining them should be done with care.  In a case I'm thinking of, adding Qt shifted resource use around sufficiently to cause substantial contention on a heretofore lightly contended lock, requiring a bit of redesign to avoid that condition.  But keeping TBB out of the line of fire of the event interface should be a good start towards making them play nice together.

Yes I have a feeling there could be conflicts in applications where TBB is not alone, but is competing with other modules that do their own multithreading. This could be the case in the TBB & Qt combination I was asking about for example.

I guess this is a general problem that has to be investigated and worked out in each individual case. A precaution of course would be to limit TBB to be used only locally (everywhere there's an algorithm that would especially benefit from being run in parallel). But maybe that's too defensive because then one may miss out on global load balancing?

I guess it's best to use TBB as globally as possible throughout an application but then again it's hard too foresee possible conflicts with competing modules. Which is the best strategy here? Is there some tool that can be used?


Robert Reed (Intel)
Total Points:
9,051
Status Points:
8,551
Brown Belt
June 15, 2009 1:09 PM PDT
Rate
 
#3 Reply to #2
Quoting - uj

Yes I have a feeling there could be conflicts in applications where TBB is not alone, but is competing with other modules that do their own multithreading. This could be the case in the TBB & Qt combination I was asking about for example.

I guess this is a general problem that has to be investigated and worked out in each individual case. A precaution of course would be to limit TBB to be used only locally (everywhere there's an algorithm that would especially benefit from being run in parallel). But maybe that's too defensive because then one may miss out on global load balancing?

I guess it's best to use TBB as globally as possible throughout an application but then again it's hard too foresee possible conflicts with competing modules. Which is the best strategy here? Is there some tool that can be used?

Well the eventual solution is to treat threads and their communications mechanisms as a common resource, shared by all applications and the libraries they use, much like Intel has promoted in collaborating with other OpenMP vendors to provide a common OpenMP library to be shared regardless of which OpenMP front end is being used, which is dependent on the compiler used.  Microsoft has suggested some directions they are considering for their next Visual Studio release and Intel is paying close attention.  Maybe someday the Qts and TBBs of the world will all be in one big happy family, sharing common thread pools and cooperating in a fashion unimaginable today.  Or maybe we'll just muddle about like we have for the last twenty years ;-).



uj
Total Points:
1,350
Status Points:
0
Brown Belt
June 16, 2009 1:19 AM PDT
Rate
 
#4 Reply to #3

Well the eventual solution is to treat threads and their communications mechanisms as a common resource, shared by all applications and the libraries they use, much like Intel has promoted in collaborating with other OpenMP vendors to provide a common OpenMP library to be shared regardless of which OpenMP front end is being used, which is dependent on the compiler used.  Microsoft has suggested some directions they are considering for their next Visual Studio release and Intel is paying close attention.  Maybe someday the Qts and TBBs of the world will all be in one big happy family, sharing common thread pools and cooperating in a fashion unimaginable today.  Or maybe we'll just muddle about like we have for the last twenty years ;-).


Thank you. Just knowing that this is a problem indeed helps; and that one gets the best result, or at least the fewest complications, if TBB rules the roost alone.

I guess languages with built-in multithreading, like Java, has an advantage. Fortunately C++ finally seems to be addressing multithreading in the upcoming standard,

http://www.devx.com/SpecialReports/Article/38883

Will this be enougth to sort this problem out, or is it at least a first step in the right direction?


adunsmoor
Total Points:
240
Status Points:
190
Green Belt
June 16, 2009 8:47 AM PDT
Rate
 
#5 Reply to #3
I don't think the language necessarily helps or hinders the solving the oversubscription problem.  C++ and Java will have similar challenges .

As an application developer you typically try to find the "right" number of threads to allocate to get the best performance.  TBB creates a pool of threads on initialization (typically) based on what it calculates to be the best number to fully utilize the processors without creating contention. 

As you mentioned, when mixed with another framework that "right" number for the application might not be quite right since the other framework might also allocate its own threads.  If you can know ahead of time that the other frameworks threads will typically be used then you can probably account for that when you initialize TBB.

I think what Mr. Reed alludes to is a more general problem that occurs when more and more applications become thread enabled (or you try to run many instances of your newly created threaded app).  Now all of the applications are trying to use all of the processors all of the time.   What is the "right" number of threads to create on startup in this case?

Quoting - Robert Reed (Intel)

Well the eventual solution is to treat threads and their communications mechanisms as a common resource, shared by all applications and the libraries they use, much like Intel has promoted in collaborating with other OpenMP vendors to provide a common OpenMP library to be shared regardless of which OpenMP front end is being used, which is dependent on the compiler used. Microsoft has suggested some directions they are considering for their next Visual Studio release and Intel is paying close attention. Maybe someday the Qts and TBBs of the world will all be in one big happy family, sharing common thread pools and cooperating in a fashion unimaginable today. Or maybe we'll just muddle about like we have for the last twenty years ;-).


For what it's worth, Apple has also proposed a model for sharing threading resources across applications in their upcoming OS X release. It would be interesting to hear Intel's position on this framework and whether TBB might one day integrate with it or perhaps support something similar on other platforms.

http://images.apple.com/macosx/technology/docs/GrandCentral_TB_brief_20090608.pdf

"Grand Central Dispatch is a revolutionary, pervasive approach to multicore processing. GCD shifts the responsibility for managing threads and their execution from applications to the operating system. Mac OS X Snow Leopard provides APIs for GCD throughout the system, and uses a highly scalable and efficient runtime mechanism to process work from applications. As a result, programmers can write less code to deal with concurrent operations in their applications, and the system can perform more efficiently."

I think we'll see a lot of interesting progress in the next few years in the state of the art for developing multi threaded applications.


Robert Reed (Intel)
Total Points:
9,051
Status Points:
8,551
Brown Belt
June 17, 2009 5:08 PM PDT
Rate
 
#6 Reply to #5
Quoting - adunsmoor
For what it's worth, Apple has also proposed a model for sharing threading resources across applications in their upcoming OS X release. It would be interesting to hear Intel's position on this framework and whether TBB might one day integrate with it or perhaps support something similar on other platforms.

http://images.apple.com/macosx/technology/docs/GrandCentral_TB_brief_20090608.pdf

"Grand Central Dispatch is a revolutionary, pervasive approach to multicore processing. GCD shifts the responsibility for managing threads and their execution from applications to the operating system. Mac OS X Snow Leopard provides APIs for GCD throughout the system, and uses a highly scalable and efficient runtime mechanism to process work from applications. As a result, programmers can write less code to deal with concurrent operations in their applications, and the system can perform more efficiently."

I think we'll see a lot of interesting progress in the next few years in the state of the art for developing multi threaded applications.

Intel's James Reinders has a few words to say here about TBB and Grand Central Dispatch.



Intel Software Network Forums Statistics

8481 users have contributed to 31614 threads and 100679 posts to date.
In the past 24 hours, we have 31 new thread(s) 115 new posts(s), and 168 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member rohit5575