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: Constantine Sapuntzakis <csapuntz_at_gmail.com>
Date: Sun, 8 Nov 2009 09:47:05 -0800

> 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
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