This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
RE: Proposal: check and read /etc/{passwd,group} less frequently.
- To: <cygwin-developers at cygwin dot com>
- Subject: RE: Proposal: check and read /etc/{passwd,group} less frequently.
- From: "Robert Collins" <robert dot collins at itdomain dot com dot au>
- Date: Fri, 14 Sep 2001 16:40:43 +1000
> -----Original Message-----
> From: Kazuhiro Fujieda [mailto:fujieda@jaist.ac.jp]
> Sent: Friday, September 14, 2001 4:49 PM
> To: cygwin-developers@cygwin.com
> Subject: Proposal: check and read /etc/{passwd,group} less frequently.
>
>
> I feel that there is no need to check and read
> /etc/{passwd,group} on every getpw* and getgw* functions.
>
> Is it enough frequent that the check is held only in
> internal_getlogin?
How often is internal_getlogin called relative to get(p|g)w*?
> If so, read_etc_{passwd,group} don't need to support multi threads
> and can be more simple.
I don't see how they would no longer need thread protection.
internal_getlogin could be updating the cache while a user thread calls
getpwuid. As far as the user is concerned, they may have a mutex or some
other mechanism no to step on their own data, instead of using
getpwuid_r, but we cannot afford to step on our internal data
regardless.
Ro