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: Florian Weimer <fweimer at redhat dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Cc: nd at arm dot com, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Date: Wed, 12 Jul 2017 16:10:58 +0200
- Subject: Re: [PATCH] Disable single thread optimization for open_memstream
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8A4207C82E
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8A4207C82E
- References: <59662DA4.1000702@arm.com>
On 07/12/2017 04:09 PM, 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.
>
> 2017-07-12 Szabolcs Nagy <szabolcs.nagy@arm.com>
>
> * libio/memstream.c (__open_memstream): Set _IO_FLAGS2_NEED_LOCK.
> * libio/wmemstream.c (open_wmemstream): Likewise.
What about the test case I posted?
Florian