PDA

View Full Version : QtConcurrent Performance



tomf
13th July 2008, 21:13
Hi!

I tried QtConcurrent today to load and scale images for my QGraphicsView. My main goal was to load large images while keeping the gui responsive. Well...QtConcurrent works fine, but my gui is everything else but responsive. I checked already my code and there is no part in my gui thread which could use the cpu power (I already disabled showing the images, just scaling for now).

Now its great that QtConcurrent makes use of both of my cores, but still 100% cpu useage is too much. I need some % for my gui too. Is there a way to tell QtConcurrent to not use everything? Maybe some priority settings? I didn't find anything in the docs.

wysota
13th July 2008, 22:37
As far as I remember you can ask it to use n (one in your case) thread at once, but then what's the point of using Qt Concurrent?

tomf
15th July 2008, 16:35
That's too bad. Whats the point of having a high level api when you can't control the basics :(

wysota
15th July 2008, 16:41
This has nothing to do with Qt Concurrent. Threads are controlled by your operating system. You can ask it to change the priority of threads it runs, but that's only a hint, so OS can ignore it.