From owner-freebsd-standards Sun Feb 9 18:29:34 2003 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 34C9137B401 for ; Sun, 9 Feb 2003 18:29:33 -0800 (PST) Received: from smtpout.mac.com (A17-250-248-89.apple.com [17.250.248.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADC1643FB1 for ; Sun, 9 Feb 2003 18:29:32 -0800 (PST) (envelope-from leimy2k@mac.com) Received: from asmtp01.mac.com (asmtp01-qfe3 [10.13.10.65]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id h1A2TWfN017329 for ; Sun, 9 Feb 2003 18:29:32 -0800 (PST) Received: from mac.com ([66.156.162.95]) by asmtp01.mac.com (Netscape Messaging Server 4.15) with ESMTP id HA2MX700.L3I for ; Sun, 9 Feb 2003 18:29:31 -0800 Date: Sun, 9 Feb 2003 20:29:31 -0600 Mime-Version: 1.0 (Apple Message framework v551) Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: thread safety From: David Leimbach To: freebsd-standards@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <7C2EF94D-3C9F-11D7-8E7D-0003937E39E0@mac.com> X-Mailer: Apple Mail (2.551) Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello Everyone, I got to spend a few hours digging through some libc code and have been trying to evaluate the situation trying to implement getpwnam_r and possibly other related functions. It seems like there are more utility functions that aren't inherently thread safe through their usage of "stateful" static variables. One such function is const ns_dbt * _nsdbget(const char * name); This function has a time_t value which is static. I don't think this function, the way it appears to be designed, can easily be made thread safe as a result. In fact now that I look at it again there is a global state stored in _nsmap that must be protected from race conditions once threads get involved. It appears that I have quite a bit of a task ahead of me. I would appreciate any support I can get... old "almost" code, pep-squad etc. :) Just letting you know it may be a while before I get a patch together as I will sure be breaking tons of stuff in the process of making this code less thread-o-phobic. Take it easy! Dave Leimbach To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message