Proposal: check and read /etc/{passwd,group} less frequently.

Robert Collins robert.collins@itdomain.com.au
Thu Sep 13 23:53:00 GMT 2001


> -----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



More information about the Cygwin-developers mailing list