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 6FE1E1F55B for ; Thu, 21 May 2020 13:07:43 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 554523972826; Thu, 21 May 2020 13:07:42 +0000 (GMT) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2044.outbound.protection.outlook.com [40.107.20.44]) by sourceware.org (Postfix) with ESMTPS id 5BCCB39724B2 for ; Thu, 21 May 2020 13:07:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5BCCB39724B2 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=Wj5AyX9B7ZjNC/mkmmidF/Guyc8RUfIDTjNLDaZoees=; b=TsbuRJ4dM0DWVObHlqFZlrlU8YpmHyJzwlmPaSOzuM2TmdIQqjQjcf9CHlz2NsVsvF1bbvxI0GJiNV5rnNopu+CvtGaLhygxN4bk91b5fXXYKBAIdZJTqYIn1u5zI2jvUCr+GYLJMgzOsCAm3McnAZFg8f+MCkCfkz8UP0/K3Zc= Received: from MR2P264CA0094.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:32::34) by AM0PR08MB3762.eurprd08.prod.outlook.com (2603:10a6:208:100::25) 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:07:36 +0000 Received: from VE1EUR03FT033.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:32:cafe::a3) by MR2P264CA0094.outlook.office365.com (2603:10a6:500:32::34) 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:07:36 +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 VE1EUR03FT033.mail.protection.outlook.com (10.152.18.147) 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:07:36 +0000 Received: ("Tessian outbound d078647f4174:v57"); Thu, 21 May 2020 13:07:36 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8ae998a9a214d6d3 X-CR-MTA-TID: 64aa7808 Received: from 9515c186a10b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 89367E70-0F4A-4C9E-8B42-B6CD093755D7.1; Thu, 21 May 2020 13:07:30 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9515c186a10b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 21 May 2020 13:07:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MQDRIHexkc1KTv4Vb77SDGFNpbNLBvo2bqXUDErnpMMyJn1HdE3wEmtR8s+ghgyP4yF0g4Q36Z5mlwIbU0k/x3lHCCak5VgNGWkG7B5LBzNqw/tSRSGsYFb3u/PzmyQVUHsuHOZv2Vfe4629cWOZDVtkItK6qkhvOvPA2ZAABhiwye+e0t8n/5ECHjnJrEN7RWZwInUAek6FFPgumzUYx2QBoVEA0adhK/hc1qep9sYsyNW1eo7QKFWFCMAJmqSuPVQ4Nexrn61Cg/zh1282DxfSCHxplTIIuQa7ubbzyODS672kAWqqtefN31MlNd0Mi9YnM3FDrTOKVnBepqPNgQ== 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=Wj5AyX9B7ZjNC/mkmmidF/Guyc8RUfIDTjNLDaZoees=; b=jnhYqtKypuPHgMpnUvFqNpEexYoyUeSSNP4Cl9cbuzjU1q/z7/sqhtiLJHMyucIMLmIAufpdR7w6682Q7XuuVFAPZ6bJ3F7NJD0qv8ndfWjdI4qoPqBo1soVJ2pNmnZ56mExInAIDiEJwfYCfC96orCHuKVUmiCNvn7ojLkQq5+xBHseQ5O8+uKPZbRffL44dqjbK+DiHv9G+g35DxOT5O/qN5cG1YNFu7TYwTS1ZP383MKCtuzPPwVgxrgu3prflJV/f1FPEcQYvy9/dcVPDrWg3P9NMmQtCVdrWjuKW4kgvalWu/lfD4OavWJLxpMpmpc/PFF3UrwIFp9eLnhJ1g== 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=Wj5AyX9B7ZjNC/mkmmidF/Guyc8RUfIDTjNLDaZoees=; b=TsbuRJ4dM0DWVObHlqFZlrlU8YpmHyJzwlmPaSOzuM2TmdIQqjQjcf9CHlz2NsVsvF1bbvxI0GJiNV5rnNopu+CvtGaLhygxN4bk91b5fXXYKBAIdZJTqYIn1u5zI2jvUCr+GYLJMgzOsCAm3McnAZFg8f+MCkCfkz8UP0/K3Zc= 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 AM6PR08MB3752.eurprd08.prod.outlook.com (2603:10a6:20b:6f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24; Thu, 21 May 2020 13:07:29 +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:07:29 +0000 Date: Thu, 21 May 2020 14:07:21 +0100 From: Szabolcs Nagy To: Florian Weimer Subject: Re: [PATCH 1/2] Add the __libc_single_threaded variable Message-ID: <20200521130721.GE14130@arm.com> References: Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: SN6PR04CA0085.namprd04.prod.outlook.com (2603:10b6:805:f2::26) 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 SN6PR04CA0085.namprd04.prod.outlook.com (2603:10b6:805:f2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24 via Frontend Transport; Thu, 21 May 2020 13:07:28 +0000 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a9908170-5a11-4aae-3a33-08d7fd87eed7 X-MS-TrafficTypeDiagnostic: AM6PR08MB3752:|AM0PR08MB3762: 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: JvS9aBhwI8PdvdLoXWIlFoi3tVB5IJhCMc+KfkKbYp0ZKC8JK5Gzu/uUyZw+P4RxxjfyGHmbPuP5EZQjFVCSfh7Xi5nTLuKouA/m2HDzfLGqF/INvhxQ57hgU8kkTP0jZ5posOnLOaItgjoOzxBDu/Sdk7wnVB1vxDq6FOvysqMmc5rO9/hGiZ42a2bM0r5htLB38p1h5iP83pIgiNK+5LH0fr+3SXZa1nwiVm0FLgtfM99pqOv3Z9EcwJtetVbg3jCrEPjV0CoqCrBIhi3r1NAL6dviLu0bxEHbkVSvHo1s4pSOAKsuQxRVLEb8Yw7P 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)(39860400002)(396003)(346002)(376002)(136003)(366004)(6666004)(1076003)(8886007)(478600001)(4326008)(6916009)(26005)(186003)(5660300002)(16526019)(7696005)(66946007)(52116002)(36756003)(2906002)(8676002)(8936002)(316002)(66476007)(66556008)(2616005)(956004)(33656002)(86362001)(55016002)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: usWoXs6H+y+7KKgSq27xD263v82zE8xnpHM0g6VDBDFHdVaGFycE+1LxNPcOjlcennJaWhnTVw5b/dR4Ej/LXioPcA15OL/QPKrqc+ScqE1P3R6nsF2ry567afNSbenrQHZza1tNMWuyeIdeOGzMP4a19fE1csm1J2TB1pjnpaCOiLDif1w2HtqNJx/rp8zgoTiqh3PP63nybnMIozjrEoWBCt1/FZjoI4Og6ZeLINil75kOkYZu0xj6VqC9hfG3MwGZhJC/rUshwoDC8HXUN9lOp8e2E9LQOik9jk7gJVwO69CbkPuI+5DDZKSrEmSScEZEloPfje8ITifduo9bS/LcuuUPnZmt/Oo1iiGUh6qWoFAyyEgRLgeQnhY1gNn8pSxHn0GwPd92OXf0G8kZs94xyq7T93ARFmhjswwzxtgdKgr7J0Tka3BhMh+0q/u5JJwzofwVZy2l2r0P4ZcJejBu7CFl922Ux9DMyaCXHWyIwWC6YXHnqmG5gK86tvVV X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3752 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: VE1EUR03FT033.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)(346002)(396003)(376002)(39860400002)(136003)(46966005)(2616005)(956004)(336012)(4326008)(70586007)(44832011)(8676002)(2906002)(36756003)(81166007)(8936002)(356005)(82310400002)(82740400003)(7696005)(70206006)(1076003)(5660300002)(36906005)(47076004)(8886007)(186003)(55016002)(86362001)(316002)(26005)(478600001)(6862004)(6666004)(33656002)(16526019); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 81f9d435-d91d-4836-cc0f-08d7fd87ea6e X-Forefront-PRVS: 041032FF37 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: duoII40E9jcMPXBg9gQILluIRYzr4dLxbJwOD49a+Ahfhnte1HH82GLaFgc+B1f6IeOLp/4lkCh/xFngwUD/BFtBcImKN+7HVFpawcMKyUPjZwnwADfX7VMWryfwlXxoZ7Km5uneUCMpk4oH0TB5aMBIxd9l3rgAmY79sG1AlkS8lOtRwkJWhMVroTy39b5sSnHzBsFxgbBSBQ6mQyHNZYThU41W9vg4BPgpdjLnZa9f77Ue/BxGbg3wwDcBwtrApZM0Q9vmGhRiP2ntd4+sdyLt17J4RcAPO2uJcwuVj7eLE8kD+HS2iJy56oZdGDmkCg11Vjdax0YboZRG806qgQ+f3ywd6uY7koOr5txCn7cHc3vpQXYHs2q4tfSMpyDZZqjYYelLsj4vhekFfULaJA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2020 13:07:36.4599 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9908170-5a11-4aae-3a33-08d7fd87eed7 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: AM0PR08MB3762 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/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. if the name is already in implementation reserved namespace this should be possible, i'm not sure if such indirect include is best practice though.