PDA

View Full Version : Slow Multi-Threading



AwDogsgo2Heaven
17th July 2009, 22:00
It appears no matter what I do in my program, the CPU usage won't go over 57-58%.

I have plots, and each plot has its own thread. The threads are for drawing each of the plots. As intensive as drawing is, I really expect for it to user higher cpu. Not only that but my program is lagging very badly, yet stuck at 57% percent cpu usage.

I was curious what possible things that could cause this when using threads. Also, im using the qwt library and I'm basically running the draw with it; however, qwt uses fonts in several places...I have tried to taken care to separate the text drawing from the rest of the drawing but could that also quite possibley be causing the lag? Could using widgets or text possibley cause these effects?
Anyways if anyone could speculate for me I'd appreciate it. Love to just hear some ideas of possibilities it could be because my brain is fryed. =D

wysota
17th July 2009, 22:21
How (and what) exactly do you draw in those threads?

AwDogsgo2Heaven
18th July 2009, 01:55
Lines mostly. The threads draw plots. pwt plots for that matter...

wysota
18th July 2009, 09:04
But draws them on what? widgets?

AwDogsgo2Heaven
19th July 2009, 21:00
No, im drawing on a QImage, one the process is done the image is emitted and a slot converts it to a pixmap which is later drawn to the screen.

wysota
19th July 2009, 21:36
Can we see the code for:
1. connecting respective signals and slots
2. spawning threads
3. slots doing the conversion
4. threads' run() methods