Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 1999 06:11:24 -0700
From:      Don Lewis <Don.Lewis@tsc.tdk.com>
To:        Dan Moschuk <dan@trinsec.com>, Joe Groff <ognir@humboldt1.com>
Cc:        louie@TransSys.COM, steve_tarkalson@hotmail.com, bmcgover@cisco.com, hackers@FreeBSD.ORG
Subject:   Re: gethostbyaddr() and threads.
Message-ID:  <199908101311.GAA07490@salsa.gv.tsc.tdk.com>
In-Reply-To: Dan Moschuk <dan@trinsec.com> "Re: gethostbyaddr() and threads." (Aug  9,  9:21pm)

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 9,  9:21pm, Dan Moschuk wrote:
} Subject: Re: gethostbyaddr() and threads.
} 
} | Well, I guess we might as well change the API, since everyone else does. Unless
} | someone comes up with a bettter idea, of course :)
} | 
} | -Joe
} 
} The API should not change.  There is already enough descrepency between UNIXs
} to warrant programs like autoconf, we should not introduce another.
} We should introduce a gethostbyaddr_r function, which shouldn't be all that
} though to implement.
} 
} >From the code that I looked at today, the problems lie inside of glibc.  It 
} declares globally a few static variables that are used by the gethost* 
} functions.  Obviously in a threaded environment, this is bad.
} 
} A nice fix would be to get rid of those variables entirely.  A quicker fix 
} would be just to enclose those global variables in mutexes.  Personally, I 
} like the nicer fix better, which will (unfortunately) involve rewriting most 
} of the frontends to the res_* functions.
} 
} If no one has any objections, I'd like to start on this tomorrow.

You might want to grab the latest BIND release from ftp.isc.org.  One
of the comments in the CHANGES file from a while ago is:

 384.   [feature]       there is now a nearly-thread-safe resolver API, with
                        the old non-thread-safe API being a set of stubs on
                        top of this.  it is possible to program without _res.
                        note: the documentation has not been updated.  also
                        note: IRS is a thread-ready API, get*by*() is not.
                        (see ../contrib/manyhosts for an example application.)

There's no sense re-inventing any more wheels than necessary.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908101311.GAA07490>