This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Add pthread_detach_pwd call.


On Mon, Oct 21, 2013 at 08:37:18AM +0200, OndÅej BÃlka wrote:
> On Sun, Oct 20, 2013 at 06:25:05PM -0400, Rich Felker wrote:
> > On Sun, Oct 20, 2013 at 07:41:09PM +0200, OndÅej BÃlka wrote:
> > > Hi,
> > > 
> > > One of problematic parts of threading is working directory. As it is
> > > global a changing it is problematic. Particulary when there is a third
> > > party library that does this without multithreading in mind.
> > > 
> > > I got idea how users could fix this without much effort. It is that we
> > > implement a pthread_detach_pwd call which will cause all subsequent
> > > queries/changes in thread be resolved by using thread local variable.
> > > 
> > > Possible disadvantage is that this would make open/fopen more complicated.
> > 
> > There is already a clean, portable way to achieve the exact same
> > thing: the *at functions. Your proposal would have very confusing
> > semantics: for example, when a thread with detached pwd creates a new
> > thread, does the new thread:
> > 
> Could you browse around 50000 open source libaries and rewrite them with
> at functions?

This is a strawman; most libraries have NO REASON WHATSOEVER to care
about the pwd.

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]