cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Busy looping bug in multi_socket interface

From: Jamie Lokier <jamie_at_shareable.org>
Date: Tue, 29 Apr 2008 23:41:58 +0100

Daniel Stenberg wrote:
> >My proposed fix is to make the splay treešs key be in microseconds
> >instead of seconds. Thoughts?
>
> It's a very reasonable idea and something I've been wanting myself. I'm all
> for it.

I presume the "busy loop" only occurs for 1 second, and then the timer
is actually run? Presuming so, changing to microseconds reduces the
busy loop time to one microsecond, which doesn't fix the logic flaw,
but at least hides it on all real computers.

I suggest also having a minimum delay which is passed to poll/select,
after it's been calculated. E.g. 50 ms. This at least stops busy
waiting from being 100% CPU waiting.

-- Jamie
Received on 2008-04-30