From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13864 invoked by alias); 29 Jun 2017 10:55:59 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 13662 invoked by uid 89); 29 Jun 2017 10:55:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*c:application X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Jun 2017 10:55:56 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70B9DC024FF5 for ; Thu, 29 Jun 2017 10:55:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 70B9DC024FF5 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=vinschen@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 70B9DC024FF5 Received: from calimero.vinschen.de (ovpn-117-36.ams2.redhat.com [10.36.117.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D13E729CB for ; Thu, 29 Jun 2017 10:55:55 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id F2213A80618; Thu, 29 Jun 2017 12:55:53 +0200 (CEST) Date: Thu, 29 Jun 2017 10:55:00 -0000 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH 3/5] Introduce _REENT_GLOBAL_STDIO_STREAMS Message-ID: <20170629105553.GC31936@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20170629061830.6992-1-sebastian.huber@embedded-brains.de> <20170629061830.6992-3-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FsscpQKzF/jJk6ya" Content-Disposition: inline In-Reply-To: <20170629061830.6992-3-sebastian.huber@embedded-brains.de> User-Agent: Mutt/1.8.0 (2017-02-23) X-SW-Source: 2017/txt/msg00508.txt.bz2 --FsscpQKzF/jJk6ya Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1669 Hi Sebastian, On Jun 29 08:18, Sebastian Huber wrote: > In Newlib, the stdio streams are defined to thread-specific pointers > _reent::_stdin, _reent::_stdout and _reent::_stderr. In case > _REENT_SMALL is not defined, then these pointers are initialized via > _REENT_INIT_PTR() or _REENT_INIT_PTR_ZEROED() to thread-specific FILE > objects provided via _reent::__sf[3]. There are two problems with this > (at least in case of RTEMS). >=20 > (1) The thread-specific FILE objects are closed by _reclaim_reent(). > This leads to problems with language run-time libraries that provide > wrappers to the C/POSIX stdio streams (e.g. C++ and Ada), since they > use the thread-specific FILE objects of the initialization thread. In > case the initialization thread is deleted, then they use freed memory. >=20 > (2) Since thread-specific FILE objects are used with a common output > device via file descriptors 0, 1 and 2, the locking at FILE object level > cannot ensure atomicity of the output, e.g. a call to printf(). >=20 > Introduce a new Newlib configuration option _REENT_GLOBAL_STDIO_STREAMS > to enable the use of global stdio FILE objects. >=20 > As a side-effect this reduces the size of struct _reent by more than > 50%. This doesn't build for me with all patches applied: winsup/cygwin/cygtls.cc:55:7: error: request for member =E2=80=98__sf=E2=80= =99 in =E2=80=98&((_cygtls*)this)->_cygtls::._cygtls::::local_clib=E2=80=99, which is of pointer type =E2=80=98_reent*=E2= =80=99 (maybe you meant to use =E2=80=98->=E2=80=99 ?) _REENT_INIT_PTR (&local_clib); Corinna --=20 Corinna Vinschen Cygwin Maintainer Red Hat --FsscpQKzF/jJk6ya Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZVNy5AAoJEPU2Bp2uRE+grF4P/0SPnA3iczNRMMBZMnVs6WUI 5DCVKv6weOvLriYXsyN3lrtEehfzAulA6PU0K/Bi0Zs9AljTGc8qlYVO9oQtdwjI YiVucGRA9q1H9IfXLnoLmAn4AuDLr0YD7mxTuXa7cIVNvpk5BwveD75GbTB1+/mR INvt8Oo/3s+9rWWm7uhFxDUXncxsbKF+nHNLHpNBT3ljwpdg8p8HEH6g4SIv2kLl oDUHEzZN1u2IvKApQtAMKiUKGLpNRj+FyyzucontR+Lri0Jywv7xzcEOWKr487xx vRXZJvoktEOJr2kQ2P6tD2f3AdCuPok+e3o82iyzCYOhUFtV7f9UZETkC2XCgczo 0Q58GV7tIfEuGCgnqGdEbXvNs7QO3kwC4ytyPbyqT6I2iJB8GBZrruK37z2nokDR B00qj5z5yd0iG/j7ErycMHwb8Q49TmWaRqK8c82nBcE9IfnOAMDgid+GRv53znYg IQwnMCLhuohgJoBgXmTAkFt+6RVgS11ey/h71mo++PzqiWBbTcEfimvaSe/rBiPF nv5evw7Xh78cIK3zleLMjHHwe9kZ55+U7ccVtHeVkoXZsBYr/Z+6xkqdA1XbMpLZ rn8wAgR8rrKCHXDSstgGgyvH8c1jSJJbTTJhFTgmrP1yCYLe4iZp7l2ntF02I9PX DPaS3ap005oIhXeqr2DN =hKGC -----END PGP SIGNATURE----- --FsscpQKzF/jJk6ya--