cURL
Haxx ad
libcurl

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

Re: [PATCH, RFC] Make hostthre.c work on POSIX

From: Rob <rob_at_thetinshack.com>
Date: Sun, 8 Nov 2009 19:12:21 +0000

On 8 Nov 2009, at 17:47, Constantine Sapuntzakis wrote:

>> Does this patch fix Multi-threading problems on OSX 10.6 even if c-
>> ares is
>> being used?
>
> This will probably not fix your problems unless you were compiling
> libcurl with --disable-ipv6.
>
> As I've integrated libcurl into a multi-threaded program, I've found
> I've had to do a couple things to ensure thread safety:
> * when I create a curl object in a thread (e.g. multi handle, easy
> handle), I only use it and destroy it in that thread
> * Add locking callbacks so that the DNS hostcache is thread safe:
>
> curl_share_setopt(g_sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
> curl_share_setopt(g_sh, CURLSHOPT_LOCKFUNC, sh_lock);
> curl_share_setopt(g_sh, CURLSHOPT_UNLOCKFUNC, sh_unlock);
>
> * Use CRYPTO_set_locking_callback to register a lock callback with
> OpenSSL so OpenSSL is thread safe.
>
> What sort of problems are you running into?
>
> -Costa
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

Hi Costa,

I launch a lot of connections at the same time, each easy handle is
created and destroyed
in its own pthread and it works flawlessly until I increase the number
of connections to
about 20 or above and then curl_easy_perform starts returning error 7
on all new handles.

I have been configuring libcurl with:

./configure --enable-ares

Having read your emails should I also be setting --enable-thread and --
enable-nonblocking?

Regards,

Rob.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-08

These mail archives are generated by hypermail.

donate! Page updated November 16, 2009.
web site info

File upload with ASP.NET