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 E81371F55B for ; Fri, 22 May 2020 10:02:02 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9C346397A4AB; Fri, 22 May 2020 10:02:01 +0000 (GMT) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30083.outbound.protection.outlook.com [40.107.3.83]) by sourceware.org (Postfix) with ESMTPS id 2D9A5385E830 for ; Fri, 22 May 2020 10:01:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2D9A5385E830 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=CuCX2jp6PHUZU+mTarfbNVG7EPft5RB5nmyYfSmaiHs=; b=uZ9STUxsXqJt7N+GeI672HFjc1KhuZ7AiLEoJYaa4jfbKAPBWyoCTa9RiFXTPR1RZQlrJ+q9ZIT2G4xmOeh4v+mrbZMSGGEi9Ot7T0YIlaDP3ZsBuiHEb67vZGo2+PcxSEmfJEW4OtLQAttlYSBdI+hiWDG7YHTYzKM7f7+BntE= Received: from AM6P194CA0077.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::18) by VE1PR08MB4861.eurprd08.prod.outlook.com (2603:10a6:802:a5::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23; Fri, 22 May 2020 10:01:56 +0000 Received: from AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8f:cafe::91) by AM6P194CA0077.outlook.office365.com (2603:10a6:209:8f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Fri, 22 May 2020 10:01:56 +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 AM5EUR03FT015.mail.protection.outlook.com (10.152.16.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Fri, 22 May 2020 10:01:56 +0000 Received: ("Tessian outbound b157666c5529:v57"); Fri, 22 May 2020 10:01:56 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 017acc9901c468f9 X-CR-MTA-TID: 64aa7808 Received: from e606bd7c8be3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EBFE4B8A-ADC4-4506-AF05-072909CE6A8C.1; Fri, 22 May 2020 10:01:50 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e606bd7c8be3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 22 May 2020 10:01:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G+Sncdjhith5/W5xHVNu6Qv+tmA7jPnnvgySIuXKEOPY4+/B9OKziRH3bGZq2l6TIWWKx2WIkCBZAsWjnLwf14Zo7lpbmM0NUcSxRm0oaQcr2o6n+VsmI3v2Dgbwilt9TMuxZMpYIWP8smCTJwUm8zuGCnm/5ZQ348ovJvMo5gNKy6XcV7kV9qxXtd3MH8Kjkcd1dW4LWJUbCv893oZZNrlDmPSTnHHNUFaCFdcR25tZ3KK7WQa1Y05UymPUxm1tVoSncLVDURdcAQd5aNmaUpcWeGyo6OforrxTygHClO3flpYFymD0pnqJdpWniTd/Aq1XQoWXTSeknc6/xSNYgg== 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=CuCX2jp6PHUZU+mTarfbNVG7EPft5RB5nmyYfSmaiHs=; b=g9jaUpgqX6Z17C5m7jwxTPbVP8F0Vbu4nTWhSuoswpS2SJHakLMecW60TvYeVVZufq9glCbiZEQGF0rTKXmeTwoiS1opk16btoFuKy4JgFQ8Xn7d9MQjfHix0L8xLnd1e3660ur/YlP5WWrZseflR2q6hTyMlQdVr3p4lzgPsZlHND5eklctmOpA1mKr/Uld8AljL6O+zpDdOqmfbL2Yl9oH8m44n76Wgn/MqTZZm+zWdAv1vI/HZ8Y6kRE/VFqlCd6qGSHZcQlnqIlnxpQlSPr2+iB3uX/pvCNNUsCX9wPmdPsg2tVXwCYdSoU+PQo5rwR6OLxY4mN8c3a8N5Y+iw== 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=CuCX2jp6PHUZU+mTarfbNVG7EPft5RB5nmyYfSmaiHs=; b=uZ9STUxsXqJt7N+GeI672HFjc1KhuZ7AiLEoJYaa4jfbKAPBWyoCTa9RiFXTPR1RZQlrJ+q9ZIT2G4xmOeh4v+mrbZMSGGEi9Ot7T0YIlaDP3ZsBuiHEb67vZGo2+PcxSEmfJEW4OtLQAttlYSBdI+hiWDG7YHTYzKM7f7+BntE= 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 AM6PR08MB5110.eurprd08.prod.outlook.com (2603:10a6:20b:d5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.26; Fri, 22 May 2020 10:01:49 +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; Fri, 22 May 2020 10:01:49 +0000 Date: Fri, 22 May 2020 11:01:47 +0100 From: Szabolcs Nagy To: Florian Weimer Subject: Re: [PATCH 2/2] manual: Document __libc_single_threaded Message-ID: <20200522100146.GA29518@arm.com> References: <2c218c9ed9586ed5491f6fa08045d1e883b126c3.1589998207.git.fweimer@redhat.com> <724ecd59-d6e4-9f52-f425-8a4ff795114f@linaro.org> <20200521130927.GF14130@arm.com> <39687760-f8b1-4209-8798-ed8a16b87b57@linaro.org> <20200521133046.GH14130@arm.com> <87k115768f.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87k115768f.fsf@oldenburg2.str.redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: LO2P265CA0292.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a5::16) 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 LO2P265CA0292.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Fri, 22 May 2020 10:01:48 +0000 X-Originating-IP: [217.140.106.55] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 689dd156-3346-4f3c-cae4-08d7fe37290c X-MS-TrafficTypeDiagnostic: AM6PR08MB5110:|VE1PR08MB4861: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-Forefront-PRVS: 04111BAC64 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: A8rdT7gteAu0Xt5Arm72piJ6VJrzop+wjeHE/sujpebLmEvy0cw0jKmee13Sfa+O6bKjvsFdtNJejnGT6FdrrNNK4RdmqnJ1DVcFywFtEdkbsk2ZpWHj+WJHjjkOqJ8hIkU3I/1kFB7zeZL8PXG8x6WEgXNaQltyWOr9Xdap5Go60Dk3TqDfuWqQfNefLQNa+ab9QjAj6DRWCJL+0ht5xIC4b7ZQ6mvIBDMkgZ1nO2GsUMe48Y4lnf89iGn7XfYdtTq4IHuqcTYfPyPE9X3JkMhrl6E65VOshLDerAMzQVoFt/swwXPe/YhAOtO3H7D4Ag2LEK9yc9pvrykJsnGa5A== 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)(136003)(376002)(396003)(346002)(366004)(52116002)(36756003)(7696005)(5660300002)(316002)(44832011)(26005)(4326008)(86362001)(956004)(6916009)(33656002)(2616005)(478600001)(55016002)(1076003)(66946007)(8886007)(4744005)(66556008)(186003)(66476007)(8676002)(2906002)(16526019)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: aoae0qwV4514naFiQWyBd/ioeR/NN4Jj2RdP9iBjQxfbGPz/efucQUBt0+h0dZ0up/0dvt9Y1FhvmInLK3lzmNU8Xso+d/EzSEGoq4WnEYWVtMJVzKYpoPjUIpxOGCV0ai3DHYEFsqHhILi0mVA0aeO6ctx8PDCfrC8U4yt4rjENlSkTWD9MEAW5d2aBxobFbLtdZJfE/oVcfGuH3FRg3UreJlTK0AyE+XVmVSttRL0G5598YlKDiRLXYa4pyuiHQ53irGsk6GcUHpSaiJYAow8+Yjz5MbxfOWIc4SDgElIzS7DMUw9aQ+v7BrzpNPZVbV0REfHGNC+tunYn4oKR52p9n4O/8jSuPFaG77iQl2BcVEI36Zpp4t/cGqCcxWQyylbJ20Wet9cvzVL2OmmGwScXlb7LeEy8Xznqx+VO4zVR0ZC7Pys3PU/m7EtIiIXFo6YSiRMgH1QPzhzpwXRL1W7pwaXHIPuW/StSIrsYXX9+B0q5f40E6AYWnyr6aaHa X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5110 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: AM5EUR03FT015.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)(376002)(39860400002)(136003)(396003)(46966005)(6862004)(70586007)(186003)(4326008)(16526019)(70206006)(7696005)(33656002)(478600001)(26005)(4744005)(5660300002)(956004)(1076003)(44832011)(36756003)(356005)(82310400002)(8936002)(36906005)(336012)(316002)(8886007)(82740400003)(55016002)(8676002)(2616005)(47076004)(86362001)(2906002)(81166007); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: dbce817d-5070-402f-d634-08d7fe3724ae X-Forefront-PRVS: 04111BAC64 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b3/vffzC0tY16EDH0RO1hAm+BWGlDsI8B/HmePLT5ddJ5B7D7Dfqy5B1VziyLtXycZgmuQKhseuBHe0i9aybMqwxkQx5sW0GMfjfsSC7DGL9EQCZrje7vmEATa+xbNS59isX4z5ERyQIKjEojHtLN0pSf25Sp5yuMcRyyS46WuU9lrcdTN8v9ywqE/SsdNQ5g4S0zViLP4Ayx1D22QJ+dKnjEzw8N8+bBTrTsoueqvJMhRF83T/hAmh2+VuaCKgmxbo0eQZ3IMXiD1gEFXjIniyZz6PzfFmTVLisPYqYREeWSJPkUQgc0Aek72YpyOC8ANAztE8ZJ3Faj0jE1MNoTcfL/qPTdRF4RkysrffVnW2MypbsmKv04J3wLf3/fupPlSggjgIxYTax5TZMPA0uiQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2020 10:01:56.0725 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 689dd156-3346-4f3c-cae4-08d7fe37290c 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: VE1PR08MB4861 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:44, Florian Weimer wrote: > * Szabolcs Nagy: > > what's wrong with pthread_join updating it? > > It's tricky do it correctly if there are two remaining threads, one of > them the one being joined, the other one a detached thread. A > straightforward implementation merely looking at __nptl_nthreads before > returning from pthread_join would not perform the required > synchronization on the detached thread exit. i'm trying to understand this, but don't see what's wrong if the last thread is detached. do you mean user code in atexit handlers? or synchronization in libc? what is libc synchronizing with in a single detached thread? so far i don't see why __libc_single_thread cannot go back to true once it was false (there may be usability issues but i need to look at some example usage to see)