Added more sleep delays to make the threads less greedy.