Re: [PATCH] pipe2: document lack of thread-safety in replacement

2012-01-26 Thread Bruno Haible
Eric Blake wrote: > > -But the replacement function is not atomic in multi-threaded programs. > > +But the replacement function is not atomic; this matters in multi-threaded > > +programs that spawn child processes. > > I like it. Thanks for the review. I've pushed it. Bruno

Re: [PATCH] pipe2: document lack of thread-safety in replacement

2012-01-26 Thread Eric Blake
On 01/26/2012 12:26 PM, Eric Wong wrote: > I can't think of a safe way to implement > SOCK_CLOEXEC/SOCK_NONBLOCK/O_CLOEXEC as-is in gnulib and have it be > forward-compatible. If we expose the flags in public headers, the OS > authors can eventually add support for these things and the native OS >

Re: [PATCH] pipe2: document lack of thread-safety in replacement

2012-01-26 Thread Eric Wong
Eric Blake wrote: > On 01/25/2012 06:09 PM, Eric Wong wrote: > > As the replacement cannot be made thread-safe, we need to > > document this to prevent users from having a false sense > > of safety. > > > > * doc/glibc-functions/pipe2.texi (pipe2): mention lack of thread-safety > > > > Signed-of

Re: [PATCH] pipe2: document lack of thread-safety in replacement

2012-01-26 Thread Eric Blake
On 01/26/2012 10:07 AM, Bruno Haible wrote: > Eric Blake wrote: >> Thread one calls pipe2(O_CLOEXEC), but gets the gnulib version, which >> first calls pipe(), then we context switch. >> Thread two calls fork(), and in the child, calls exec() > > Right, this is why pipe2 should better be atomic. >

Re: [PATCH] pipe2: document lack of thread-safety in replacement

2012-01-26 Thread Bruno Haible
Eric Blake wrote: > Thread one calls pipe2(O_CLOEXEC), but gets the gnulib version, which > first calls pipe(), then we context switch. > Thread two calls fork(), and in the child, calls exec() Right, this is why pipe2 should better be atomic. But this goes beyond of what is normally understood b

Re: [PATCH] pipe2: document lack of thread-safety in replacement

2012-01-26 Thread Eric Blake
On 01/25/2012 06:09 PM, Eric Wong wrote: > As the replacement cannot be made thread-safe, we need to > document this to prevent users from having a false sense > of safety. > > * doc/glibc-functions/pipe2.texi (pipe2): mention lack of thread-safety > > Signed-off-by: Eric Wong > --- > I took th

Re: [PATCH] pipe2: document lack of thread-safety in replacement

2012-01-26 Thread Eric Blake
On 01/26/2012 07:28 AM, Bruno Haible wrote: > Eric Wong wrote: >> As the replacement cannot be made thread-safe, we need to >> document this to prevent users from having a false sense >> of safety. >> >> * doc/glibc-functions/pipe2.texi (pipe2): mention lack of thread-safety > > Can you please des

Re: [PATCH] pipe2: document lack of thread-safety in replacement

2012-01-26 Thread Bruno Haible
Eric Wong wrote: > As the replacement cannot be made thread-safe, we need to > document this to prevent users from having a false sense > of safety. > > * doc/glibc-functions/pipe2.texi (pipe2): mention lack of thread-safety Can you please describe a situation with multiple threads where gnulib's

[PATCH] pipe2: document lack of thread-safety in replacement

2012-01-25 Thread Eric Wong
As the replacement cannot be made thread-safe, we need to document this to prevent users from having a false sense of safety. * doc/glibc-functions/pipe2.texi (pipe2): mention lack of thread-safety Signed-off-by: Eric Wong --- I took the line off the existing documentation for the similar-in-p