From owner-freebsd-hackers Tue Aug 10 6:12:14 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from gatekeeper.tsc.tdk.com (gatekeeper.tsc.tdk.com [207.113.159.21]) by hub.freebsd.org (Postfix) with ESMTP id 50976153E4 for ; Tue, 10 Aug 1999 06:12:11 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from sunrise.gv.tsc.tdk.com (root@sunrise.gv.tsc.tdk.com [192.168.241.191]) by gatekeeper.tsc.tdk.com (8.8.8/8.8.8) with ESMTP id GAA28488; Tue, 10 Aug 1999 06:11:26 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from salsa.gv.tsc.tdk.com (salsa.gv.tsc.tdk.com [192.168.241.194]) by sunrise.gv.tsc.tdk.com (8.8.5/8.8.5) with ESMTP id GAA08074; Tue, 10 Aug 1999 06:11:25 -0700 (PDT) Received: (from gdonl@localhost) by salsa.gv.tsc.tdk.com (8.8.5/8.8.5) id GAA07490; Tue, 10 Aug 1999 06:11:24 -0700 (PDT) From: Don Lewis Message-Id: <199908101311.GAA07490@salsa.gv.tsc.tdk.com> Date: Tue, 10 Aug 1999 06:11:24 -0700 In-Reply-To: Dan Moschuk "Re: gethostbyaddr() and threads." (Aug 9, 9:21pm) X-Mailer: Mail User's Shell (7.2.6 alpha(3) 7/19/95) To: Dan Moschuk , Joe Groff Subject: Re: gethostbyaddr() and threads. Cc: louie@TransSys.COM, steve_tarkalson@hotmail.com, bmcgover@cisco.com, hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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