From owner-freebsd-hackers Mon Aug 9 18:19:50 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from home.humboldt1.com (home.humboldt1.com [206.13.45.1]) by hub.freebsd.org (Postfix) with ESMTP id 0CE8514FD0 for ; Mon, 9 Aug 1999 18:19:48 -0700 (PDT) (envelope-from ognir@humboldt1.com) Received: from shovel.groff (ppp177-pm5.humboldt1.com [207.104.21.170]) by home.humboldt1.com (Pro-8.9.2/Pro-8.9.2) with SMTP id SAA02821; Mon, 9 Aug 1999 18:16:18 -0700 (PDT) Date: Mon, 9 Aug 1999 18:16:18 -0700 (PDT) Message-Id: <199908100116.SAA02821@home.humboldt1.com> From: Joe Groff To: dan@trinsec.com Cc: louie@TransSys.COM, steve_tarkalson@hotmail.com, bmcgover@cisco.com, hackers@FreeBSD.ORG Reply-To: ognir@humboldt1.com Subject: Re: gethostbyaddr() and threads. In-Reply-To: <19990809212147.A47699@trinsec.com> X-Mailer: XCmail 1.0.0 - with PGP support, PGP engine version 0.5 (FreeBSD) X-Mailerorigin: http://www.fsai.fh-trier.de/~schmitzj/Xclasses/XCmail/ MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG ---Dan Moschuk said: > > | 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. That's what I meant by an API change. Sorry for not being clearer. However, if you can roll in reentrancy without having to add the _r functions, that would save some sweat on the programmers' side. >>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. > Go for it! Someone needs to. :) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message