cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Re: llist->next off by one

From: Giuseppe Attardi <attardi_at_di.unipi.it>
Date: Thu, 13 Nov 2003 11:57:57 +0100

Yes, I do use a global cache: I thought that using ARES this
had become thread safe.

However I am using a multihandle, so I would like indeed the cache
to survive the easy_handle and to be shared among the handles
in a multi_handle.

-- Attardi

----- Original Message -----
On Wed, 12 Nov 2003, Giuseppe Attardi wrote:

> It looks like the problem is due to a lack of thread safeness. The
hostcache
> data structure seems to be shared among threads, according to what I see
> with gdb when the problem occurrs:

The host cache is not supposed to be shared between threads unless
specificly
told so, either by using the global dns cache option or by using the share
interface.

I must admit I can't see in what way it shares the data.

> [Switching to thread 16 (Thread 14351 (LWP 19859))]
> Curl_hash_clean_with_criterium (h=0x81cb8a0, user=0x4c1ff46c,
> comp=0x812eeb4 <hostcache_timestamp_remove>) at hash.c:256
> (gdb) p list.head
> $1 = (curl_llist_element *) 0x84c7718
>
> [Switching to Thread 12301 (LWP 19857)]
> Curl_hash_clean_with_criterium (h=0x81cb8a0, user=0x4adff46c,
> comp=0x812eeb4 <hostcache_timestamp_remove>) at hash.c:256
> (gdb) p list.head
> $8 = (curl_llist_element *) 0x84c7718
>
> If this is the problem, syncronization must be added in dealing with the
dns
> host cache. I can help on that if you like.

And this is without a global cache selected?

-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
Received on 2003-11-13