
20 Aug
2012
20 Aug
'12
4:11 a.m.
Hi
Is there anyway to reduce overhead of threadFoo() call in this simple program ?
class baseClass {
public:
void foo(){
boost::posix_time::milliseconds delay(143);
boost::this_thread::sleep(delay);
}
void threadFoo(){
threadObjOne = boost::thread(&baseClass::foo, this);
threadObjTwo = boost::thread(&baseClass::foo, this);
threadObjOne.join();
threadObjTwo.join();
}
private:
boost::thread threadObjOne;
boost::thread threadObjTwo;
};
int main(){
std::cout<< "main startup"<