I am writing an queue processing application which uses threads for waiting on and responding to queue messages to be delivered to the app. For the main part of the application, it just needs to stay active. For a code example like:
while True: pass
or
while True: time.sleep(1)
Which one will have the least impact on a system? What is the preferred way to do nothing, but keep a python app running?
See Question&Answers more detail:os