This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Disable single thread optimization for open_memstream
- From: Carlos O'Donell <carlos at redhat dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>, GNU C Library <libc-alpha at sourceware dot org>, Florian Weimer <fweimer at redhat dot com>
- Cc: nd at arm dot com
- Date: Fri, 14 Jul 2017 10:06:59 -0400
- Subject: Re: [PATCH] Disable single thread optimization for open_memstream
- Authentication-results: sourceware.org; auth=none
- References: <5968C08E.60008@arm.com>
On 07/14/2017 09:01 AM, Szabolcs Nagy wrote:
> Single thread optimization is valid if at thread creation time the
> optimization can be disabled. This is in principle true for all
> stream objects that user code can access (and thus needs locking),
> using the same internal list as fflush(0) uses. However in glibc
> open_memstream is not on that list (BZ 21735) so the optimization
> has to be disabled.
>
> OK with the test?
>
> 2017-07-14 Szabolcs Nagy <szabolcs.nagy@arm.com>
> Florian Weimer <fweimer@redhat.com>
>
> * libio/memstream.c (__open_memstream): Set _IO_FLAGS2_NEED_LOCK.
> * libio/wmemstream.c (open_wmemstream): Likewise.
> * nptl/tst-memstream.c: New.
>
OK to checkin if you add a pargraph comment to tst-memstream.c
explaining the test invariants, expectations, and exactly what
is being tested and why.
--
Cheers,
Carlos.