title: Does a worker thread need to sleep?
body: <p>A normal worker thread runs in a loop in which it checks for available tasks in a queue and consumes them. I've seem some examples where the thread waits a couple of milliseconds when there is no available task, using <code>std::this_thread::sleep_for()</code> for example. However, I want my thread to consume the tasks with minimal latency, so I don't use a sleep. Is that any bad? Should a worker thread sleep for some milliseconds when checking for tasks?</p>