cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Locking and multi on multiple connections.

From: Michael Menegakis <arxeio_at_gmail.com>
Date: Thu, 9 Dec 2010 01:14:27 +0200

On Thu, Dec 9, 2010 at 12:59 AM, Alan Wolfe <alan.wolfe_at_gmail.com> wrote:
> Lock as in your computer freezes up and never comes back?

Lock as in the multi documentation. The documentation on the multi
mechanism explicitly states that there is no waiting of the
application for completion as it is the case with easy handles and one
can cycle through the functions involved and only receive their data
once they are completed. This is indeed the case. Unlike easy alone,
with a multi I can have a single threaded application have
connections, even multiple connections without waiting on them on the
single threaded application, and having it 'locked' that way till
completion.

The issue here is that I noticed often on the very first request for a
fetch, I get a very brief lock. It appears to be some kind of
initialization causing it.

I turned on logging with CURLOPT_VERBOSE right now and everything seems fine.

The first is connecting and completes.

The second connects on the existing connection and completes,
everything's fine.

I just wonder if very close-to-each-other simultaneous connections are
normal to be causing a 'locking' behavior and if it's normal for the
very first easy to be - sometimes - causing a brief lock on the
application, which I suspect is internal cURL initialization.

Right now I have made an external explicit flooding protection
mechanism by requiring every easy request on the multi to be done at
least 0.8 seconds apart from the last one and I consider of
initializing the application with a dummy easy request to google.com
or something.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-09