From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 562001F55B for ; Thu, 21 May 2020 13:26:57 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 446BB3973013; Thu, 21 May 2020 13:26:56 +0000 (GMT) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60063.outbound.protection.outlook.com [40.107.6.63]) by sourceware.org (Postfix) with ESMTPS id 1F745397300F for ; Thu, 21 May 2020 13:26:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1F745397300F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SXAz2HtUib+O12Kl3JFxxFL7L1QMdGgGE3JBuu0jKsY=; b=A5dqwnm1AhlCVX6e8BnfmEVpsUXKthYLT7MLI/VjzbszkwzOeGgF7O/3m6/SzexTesrOKQ5hughFvQi/g4fuQvm6NnD47LsxDlsl52/Ntd8hvaT9qJjGX+GXp6LzpbxhGOLQTQvQFi5uzL5KYNigNbeGjRFaRw1SvLtcE8sq6V8= Received: from DB8PR04CA0018.eurprd04.prod.outlook.com (2603:10a6:10:110::28) by AM4PR0802MB2337.eurprd08.prod.outlook.com (2603:10a6:200:5f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23; Thu, 21 May 2020 13:26:51 +0000 Received: from DB5EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:110:cafe::ea) by DB8PR04CA0018.outlook.office365.com (2603:10a6:10:110::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.26 via Frontend Transport; Thu, 21 May 2020 13:26:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT059.mail.protection.outlook.com (10.152.21.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 13:26:50 +0000 Received: ("Tessian outbound cff7dd4de28a:v57"); Thu, 21 May 2020 13:26:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 346c00b041a8bcca X-CR-MTA-TID: 64aa7808 Received: from abca1aa22d8d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1C1A574F-4BA3-4724-80E9-241A855A6A29.1; Thu, 21 May 2020 13:26:45 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id abca1aa22d8d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 May 2020 13:26:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HBw8QQ7h355SetYMrK7H37ZjQ23vnc3QqRLjsmLTjgrUQzy7I9ndZmY+KLlGJkqlLhLLv5ljZgJe3FOWfB5Ab6/NE/E9liKTl8zIBW+tsaJeg2EMDf/y7nd6IXf3YTwJunylhObalpms34aVHM8UZQX2GxgmBV3hg1WNWd90s4/2Rl9NDOo0VB1SiCpc0pIv+5xkAFnJKOZGfMDbnib1pH8Hg4mkvSEw8PTvBNJrzMwFb8Kl6bD5LpzAx198fy25hi3s0ltJoJUVj9U/ifC5m8wkUwKAw6JmmTCNsW58GQoZUj9o3T5XygujcM2QKYDzqCg0QfHSf8QwGn5gQjT/oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SXAz2HtUib+O12Kl3JFxxFL7L1QMdGgGE3JBuu0jKsY=; b=AwZ7Y5JVXlY/8lkG1vcFkhEk+3jtoWmkgbkFEKwa1X6oILYaYu5+un4OYPO9OmNLDwzw+BrZYrGE3n4qIVOXq6yb2d3tXK0/MGGPAD27nC9Fazd9EyjNbzZ2k6EwBUmhswg4pU/FuTIdlk3QHxQQEIPaBADF69nBYvHqSjskpkMgUJtzU4j7/g1sSoU4Dk759QQVwYfWaatNEZHxU1Yw3ankN4wMfiSsFsg3ChGzZNh/yAtGrOF06yqyj3dUurDHsud3l6w7B0G2FSbhS3oRTR8wxssC2IBe2soxfqzwCqqe4mE/jUG86w834nLG5UTnR9waTeKMpYI5pNB8Jqv45A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SXAz2HtUib+O12Kl3JFxxFL7L1QMdGgGE3JBuu0jKsY=; b=A5dqwnm1AhlCVX6e8BnfmEVpsUXKthYLT7MLI/VjzbszkwzOeGgF7O/3m6/SzexTesrOKQ5hughFvQi/g4fuQvm6NnD47LsxDlsl52/Ntd8hvaT9qJjGX+GXp6LzpbxhGOLQTQvQFi5uzL5KYNigNbeGjRFaRw1SvLtcE8sq6V8= Authentication-Results-Original: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) by AM6PR08MB3333.eurprd08.prod.outlook.com (2603:10a6:209:45::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.26; Thu, 21 May 2020 13:26:43 +0000 Received: from AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862]) by AM6PR08MB3047.eurprd08.prod.outlook.com ([fe80::49fd:6ded:4da7:8862%7]) with mapi id 15.20.3021.020; Thu, 21 May 2020 13:26:43 +0000 Date: Thu, 21 May 2020 14:26:41 +0100 From: Szabolcs Nagy To: Florian Weimer Subject: Re: [PATCH 1/2] Add the __libc_single_threaded variable Message-ID: <20200521132641.GG14130@arm.com> References: <20200521130721.GE14130@arm.com> <87sgft77i0.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87sgft77i0.fsf@oldenburg2.str.redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: LO2P265CA0239.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:b::35) To AM6PR08MB3047.eurprd08.prod.outlook.com (2603:10a6:209:4c::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.55) by LO2P265CA0239.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:b::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Thu, 21 May 2020 13:26:43 +0000 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dda5d53f-32ae-41b3-54d9-08d7fd8a9eed X-MS-TrafficTypeDiagnostic: AM6PR08MB3333:|AM4PR0802MB2337: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-Forefront-PRVS: 041032FF37 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: UFNXMi4ndWo77gz/knktDHmXxJStkNqdgJCHYDyNd5+CUQynJ/uIPcle6OcSUvs2twWPq28ZElZ8UcOATFAZ6Ne9rxycvtokKgsyR0E+W5mPDyDlpWjftC4fsnMPcenPkmex7A4xnY9WiWGZdRVDhUz+wDf8fSgmtJc1LhzawHid7XrKnF5i1BUca/PT+5sPqSYe2U6eNUD2l3FSuEkWUxKxG737JNtHQ++v0C+b2qE9cUaTPaDGT+4xLRFMogggvo9KqmTEGx8sR9/FNCS+6SDHa0yZ4TJBg9Ujo2b5huq5W0SfwRFwg0CKxiebo4WuVX17jKvUpuiUbu/FabEJXCL+9egIaqFZPjgM0kr1SDm6RTsVVRouEwCpQU9r/Yr+oLdq++wSp7PamVyl/hpLLnfMRoPc+XT1Ogels8XywV9bgs2l7rVxO7hrJQrdKCxA X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB3047.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(136003)(366004)(346002)(396003)(39860400002)(7696005)(186003)(16526019)(8936002)(44832011)(478600001)(36756003)(4326008)(6916009)(26005)(956004)(86362001)(52116002)(5660300002)(2616005)(8676002)(8886007)(1076003)(55016002)(2906002)(316002)(66556008)(66946007)(66476007)(33656002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: XjWnkQDYIMVqZQ3LaSExZYPKeGNoxEtdCVGTYs7T/iJTut99hH+dtit6VjHg0vu4bgBg47MlN8ceorKWEolWy71I+zSBflDKiIoWO+n55JZTCJ6l9CIRCtelRtCVDtomSs2IPHCdFcr4wPTWFUi7ooxKFyvOD018RhW96L5lMpn3lnlMJY63J5N2KQZJZargbFhT/Fxbu6QesEwEaO0lHnTdASoMNw5LylKsmSF9qvRSo02pyKsokf44rsAPOburzeHK7M/SvOGPt2RxA9PGIHwOQDUVm8SMS5KJVcScnzBPeKH2pAbWdBN36beUK/2D9/8dWmi52ie+/KSMa/2ChQljPP22BnLDOZSKHTr83XZt7gDqASI+suoCUQwerE170StsrIMZf3D+YTzJSehOQrWZCEnaA5S4gVJYbAwK7RmVfP3XyiaUyq2PUmYYu7T8jvKp5cpxqDox1QPusF2XZBE52LrSVndrtv78s1X3dnfpeU0pbppb4HaKU5el4RYg X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3333 Original-Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT059.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(4636009)(136003)(39860400002)(376002)(346002)(396003)(46966005)(8886007)(316002)(82310400002)(4326008)(356005)(36756003)(336012)(81166007)(47076004)(82740400003)(70586007)(8936002)(2906002)(6862004)(5660300002)(26005)(16526019)(55016002)(478600001)(7696005)(44832011)(956004)(8676002)(186003)(70206006)(2616005)(1076003)(33656002)(86362001); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: fbc5d3b9-64f3-4d2e-1b53-08d7fd8a9a6c X-Forefront-PRVS: 041032FF37 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qN8csUikIS7bitf4U6jAOovYeiv0Omzgpk9MenIMiyQnnNoqxZw0mygX/GDsjYMaQXjcx2dfu5Z0/hkhvgDAs5CSAaGOh+R4+u0Xh8vLMQ4/W2SX7M0MTkFynKm7rca11RAVtO7xeECiD3rhpLiiqO0OCwT8dl0TrlHF7CzPpg8wuTjKrrSjm+08VZg7kY0H2EA3lD8GnPB5cbJ8dGLAZdaxYopuCOzoQHY4ntZIC12/EGJVT/MfdpNu5nfuPTGZesml25/fjGwIWPOYMIU9vWaLkUMZ1ssyzd6otMdb3aauy+RQdgOTLYPXLHgBkDv/MnXee7hS5c/+NNPcxzKmfLOgfsxqBum0DVCHpubXM9xRFZI9ObInE2CZHfBmO8DhPoaAfTyClT11pZXCV72UYw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 13:26:50.9802 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dda5d53f-32ae-41b3-54d9-08d7fd8a9eed X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2337 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The 05/21/2020 15:16, Florian Weimer wrote: > * Szabolcs Nagy: > > The 05/20/2020 20:12, Florian Weimer via Libc-alpha wrote: > >> The variable is placed in libc.so, and it can be true only in > >> an outer libc, not libcs loaded via dlmopen or static dlopen. > >> Since thread creation from inner namespaces does not work, > >> pthread_create can update __libc_single_threaded directly. > >> > >> Using __libc_early_init and its initial flag, implementation of this > >> variable is very straightforward. A future version may reset the flag > >> during fork (but not in an inner namespace), or after joining all > >> threads except one. > >> --- > > ... > >> +* The GNU C Library now provides the header file > >> + which declares the variable __libc_single_threaded. Applications are > >> + encouraged to use this variable for single-thread optimizations, > >> + instead of weak references to symbols historically defined in > >> + libpthread. > > > > i wonder if the new header can be included into > > threads.h and pthread.h, and a feature macro added > > for it, so users can avoid doing a header check. > > Isn't __has_include in current compilers sufficient for that? > > The advantage of the current approach is that libstdc++ headers can use > __has_include on the new headers, without pulling in other headers which > declare identifiers which are not in implementation namespace and also > not expected to be used by C++ standard headers. ok i guess __has_include is fine (assuming the macro expansion bugs are fixed)