Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
5 Views

Question on Multi-Thread on Multi-Core

Hi All,

I wrote a non-threaded program which loads12 video clips (CIF resolution)from hardisk and apply some object recognition using openCV. From my observation, the CPU usage is around 60% (task distribution for both cores are not equal). So i thought in order to utilize my multi-core system, i should modify the program to be a threaded one. Well, I created a thread to handle each video clips. Each of the thread will have their own set of CvCapture pointer, retrieveit's own video frames, process anddisplay them. After executing the program, the CPU usage turned out to be 100%. My feeling tells me that this must be something wrong as the CPU usage should be lesser than 60% (theoretically) Anyonefacing this before?

*i'm using WinXP with Intel C2D T7400. Program developed using C++
*i'm using win32 threads (eg: _beginthreadex)

0 Kudos
2 Replies
Highlighted
5 Views

Sawguan,

I suggest you consider using a profiler program such a vTune or CodeAnalyst. This will quickly locate where the code is spending it's time.

Jim Dempsey

0 Kudos
Highlighted
Employee
5 Views

If I understand correctly, your serial code has a CPU utilization of 60%. You wanted greater CPU utilization, so you threaded the code. Now the CPU utilization is at 100%. I would say your threading succeeded.

Or am I missing something? (for example, the CPU utilization increased, but the total run time didn't decrease?)
0 Kudos