On 12/12/07, Guido van Rossum <guido at python.org> wrote: > > On Dec 12, 2007 2:42 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote: > > But there's no excuse for using CPU when the application > > truly isn't doing anything other than waiting for > > something to happen. > > There are tons of situations where polling is quite reasonable as logn > as it involves a sleep. Now that I have to disagree with, possibly because sleep is ambiguous as stated. Periodic time based polling means your APIs are broken (not that one often has control over what APIs are available). Blocking only to be woken up when any of the events your interested in is always best. If you have periodic tasks that must be performed then obviously an event you're interested in is "time T or X time has passed" but that is distinct from a process waking up regularly to check the empty work queue length only to sleep again. Regardless this thread already resolved the issue with an acceptable solution (yay!) so further discussion is merely a bike shed. -gps -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-dev/attachments/20071213/ab17deba/attachment.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4