Is it a bad practice to put a thread in a while(true) loop and test if a condition is ok to start a treatment?

```
void run()
{
    for(;;)
    {
        if(dataReady)
        {
            processData();
        }
    }
}

```

is it preferable to use wait/condition mechanism :

```
void run()
{
    for(;;)
    {
        if(dataReady)
        {
            processData();
        }
        lock_guard lock(mutex);
        condition_.wait(lock);
    }
}

```

Another thread of course calls `condition_.notify_one()`

EDIT:

I expect to almost never wait.