Date: Sun, 9 Feb 2003 20:29:31 -0600 From: David Leimbach <leimy2k@mac.com> To: freebsd-standards@freebsd.org Subject: thread safety Message-ID: <7C2EF94D-3C9F-11D7-8E7D-0003937E39E0@mac.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7C2EF94D-3C9F-11D7-8E7D-0003937E39E0>