I have an application that is run in a for loop:
// initialization
for (std::vector< VerifObj >::const_iterator itVOV = verifObjVector.begin(); itVOV != verifObjVector.end(); itVOV++)
{
// run my application for itVOV
std::cout << "\b\b\b\b" << std::setw(3) << static_cast< int >(100.f * ++photoCntr / verifObjVecSz) << "%"
<< std::flush;
std::this_thread::sleep_for(std::chrono::milliseconds(30));
}
std::cout << "\b\b\b\b" << std::setw(3) << "100%" << std::endl;
Because each iteration is taking some minutes, I thought to make it multi thread, so it can run faster. I am a beginner in multi threading so, I am asking how to do it?