Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Improved implementation of *env(3) functions in "libc"



On Nov 18, 2010, at 11:32 18AM, Andrew Doran wrote:

> On Thu, Nov 18, 2010 at 11:07:51AM -0500, Steven Bellovin wrote:
>> 
>> On Nov 18, 2010, at 10:47 37AM, Andrew Doran wrote:
>> 
>>> My concern with using a tree is that it makes a concurrent getenv() very
>>> hard to implement, and threaded programs like to make use of getenv().
>>> 
>>> Reader-writer locks don't scale on multi-core systems, and applications
>>> like this one (getenv) may give you single threaded or worse behaviour.
>>> 
>>> 
>> I don't think this is a serious issue for getenv().  Most applications make
>> very little use of it; when they do, it's generally at initialization time.
>> Nor, I suspect, is single-threading a huge concern, since the lock will be
>> held for a very short time.
> 
> Unfortunately it's not about hold time, but cache writebacks to main memory
> causing effective single threading.

Right, but that's only an issue if calls to getenv() are frequent.  I suspect
that they're quite rare, especially as a percentage of runtime.
> 


                --Steve Bellovin, http://www.cs.columbia.edu/~smb







Home | Main Index | Thread Index | Old Index