There is nothing wrong with having a while statement in a thread, as long as it doesn't enter an infinite loop. Putting a blocking function in there will freeze up the thread if you don't receive any data. It wouldn't be bad if you are sure you will receive data.