cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: sharing DNS

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 16 Jan 2003 13:56:06 +0100 (MET)

On Wed, 15 Jan 2003, Jean-Philippe Barrette-LaPierre wrote:

> I allmost finished the implementaion of the sharing DNS thing. However
> there's missing thing to get thread-safe: a function that duplicate a
> "Curl_dns_entry *".

Eh. Why do we need to duplicate something that is shared?

> The problem is with the hostcache_prune function, the function that clean
> all outdated hostcache entry. At this time it's using the inuse variable,
> but it's not thread-safe, so I'll need a dns_entry duplicate function.

Now, please tell me why the 'inuse' struct field is not thread safe? As long
as we access it while having the mutex, it should be perfectly OK. And then
we can share the structs fine. Or am I wrong?

> P.S. I don't have a deepfull knowledge of the addrinfo structure(to be
> portable), so I can't do the duplicate function myself.

We do not want to walk down that path. We simply must do it another way.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en
Received on 2003-01-16