Keeping the thread alive is not an easy task.