While loop bug? Stuck on empty

It could be that with the print statements commented out the while-loop is hogging the CPU. I suggest that you put the thread to sleep for about 20 milliseconds inside the loop so that the other threads are not starved of CPU time.

1 Like