I don’t understand this code:
void ThreadPoolThread::run()
{
while (! threadShouldExit())
{
if (! pool.runNextJob())
wait (500); // Here, what's for ?
}
}
My jobs do very fast and small things, but it’s slow to close.
Maybe a lower value would be more appropriate ? Or this:
void ThreadPoolThread::run()
{
while (! threadShouldExit())
{
if (! pool.runNextJob())
{
for (int i = 0; i < 5; i++)
{
if (threadShouldExit()) break;
wait (100); // Here, what's for ?
}
}
}
}