Subject: Re: Are res_send and res_query thread-safe?
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: Greg A. Woods <>
List: tech-userlevel
Date: 04/04/2004 15:09:34
[ On Saturday, April 3, 2004 at 15:28:43 (-0500), Christos Zoulas wrote: ]
> Subject: Re: Are res_send and res_query thread-safe?
> On Apr 3,  3:23pm, ("Greg A. Woods") wrote:
> -- Subject: Re: Are res_send and res_query thread-safe?
> | (which I assume is really the BIND-8 resolver as ported to BIND-9 (from
> | lib/bind in the distributed source), and not the true BIND-9 lwres
> | library (from lib/lwres), right?)
> | 
> | Can you expand a bit here on what you've done to resolve the nsswitch
> | vs. ISC IRS functionality, if anything?
> There is no IRS there. IRS is in the get*() routines which we use our old
> ones. I've merged some of the changes from bind9 that seemed useful, but
> mostly our code is better.

Ah, OK, so saying "libc with bind9" was incomplete, if not a bit
misleading, at least to those of us who've been trying to think of some
way to do a wholesale switch to a resolver maintained in a larger scope.

You didn't port BIND-9's lib/bind (or lib/lwres) to NetBSD's libc, so
much as simply take some of the changes from BIND-8/9 and apply to them
to NetBSD.

BTW, does anyone have any existing analysis of what's better in the
NetBSD code and which could be given back to ISC to improve the generic
BIND resolver?

> The multi-threaded issue of having one _res per
> thread needs to be addressed and we should have a pool of _res.

Well you need one _res per thread I think, or at least one for every
thread that ever does any DNS lookup.  From the application's point of
view I think the API has to match whatever BIND-8/9 does, so is there
really anything that can be done?

						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <>
Planix, Inc. <>          Secrets of the Weird <>