[Spread-users] Spread python poll() taking almost 100% CPU
George Schlossnagle
george at omniti.com
Fri Oct 1 17:58:31 EDT 2004
On Oct 1, 2004, at 5:23 PM, Brian Moseley wrote:
> Tim Peters wrote:
>
>> You'll be happy with that; or, if you don't want to do anything other
>> than get msgs, just do a straight:
>> msg = mbox.receive()
>> and let it worry about figuring out when a msg is available.
>
> i was having the same problem as the original poster, so i switched to
> the poll/sleep technique. seems to work fine.
>
> i'd prefer to not have to poll tho, for the reason you mentioned.
> using poll, i have to continuously check that the connection is still
> connected, and reconnect if it somehow dropped away underneath. yuck.
In C you can actually just poll() (with a timeout of course) on mbox,
which is a file descriptor.
George
More information about the Spread-users
mailing list