I have a thread which is running in a loop and executing tasks.
outTask::Task* task;
while (!m_out_stop) {
println("abc");
while (m_outQueue.pop(task)) {
println("123");
task->execute();
}
}
How can I make this less CPU intensive? I could make the thread sleep between each task, but that would cause a delay, and is therefore not an ideal solution.
Ps. Print statements are for debugging purposes.