L
linyanhung
I used a boost multi thread in VS 2005 on a Duo Core PC, and made a two
thread process.
The code is something like this:
#include <boost/thread/thread.hpp>
void fun1()
{
//do something
}
void fun2()
{
//do something
}
int _tmain(int argc, _TCHAR* argv[])
{
boost::thread thrd(&fun1);
boost::thread thrd2(&fun2);
thrd.join();
thrd2.join();
return 0;
}
It can run, but run on only one of the two cores. The CPU usage is 50%.
Isn't that multi-thread can improve proformance on multi-core CPU?
Any help would be appreciated.
thread process.
The code is something like this:
#include <boost/thread/thread.hpp>
void fun1()
{
//do something
}
void fun2()
{
//do something
}
int _tmain(int argc, _TCHAR* argv[])
{
boost::thread thrd(&fun1);
boost::thread thrd2(&fun2);
thrd.join();
thrd2.join();
return 0;
}
It can run, but run on only one of the two cores. The CPU usage is 50%.
Isn't that multi-thread can improve proformance on multi-core CPU?
Any help would be appreciated.