Sockets and threads

Jude Venn jude-venn at blueyonder.co.uk
Thu Jun 12 20:14:19 CEST 2003


On Thu, 12 Jun 2003 16:16:39 GMT
"Byron Morgan" <lazypointer at yahoo.com> wrote:
> def main():
>     while not msvcrt.kbhit():
>         pass
>         #sleep(5)
>         #uncomment sleep statement and cpu usage returns to normal.

There's your answer. Try...

>>> while 1: pass

...and see your cpu usage skyrocket. you'll have to sleep a bit to give the other thread(s) some space.

HTH,
Jude





More information about the Python-list mailing list