From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cc-smtpout1.netcologne.de (cc-smtpout1.netcologne.de [IPv6:2001:4dd0:100:1062:25:2:0:1]) by sourceware.org (Postfix) with ESMTPS id EDFBA3858D39; Mon, 23 Oct 2023 05:53:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EDFBA3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=netcologne.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=netcologne.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EDFBA3858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4dd0:100:1062:25:2:0:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698040391; cv=none; b=vNPJOJmRhU9wzOZaDcU8l9EborUrSosOJzTVtSkd/+XfoGgwC8k9L9nQVERUVQDU7pBnWfcHljfYrBezGQEVdMLQ6BXC9F7U7m6eEh3YCP61RasW3UDWssDtdBR+5Dq1LnfmbRiFKysoQGwf0/OHExSRQ1UPfSGdmSzpztXLLWM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698040391; c=relaxed/simple; bh=/8koqY7Aal0nobEMJHIW61gixnZqbYo3wzgWfNNFLXM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=WisvrZWvDgxiD/+IGfz92dybBYhlmmJ7gYuK07lGis8rbh5dCftdKT0zQctufb0CaRy7/s5qiX27zMnOBlA4rsFaUSjSll+tEmTYsASZsq3ZwkfhVvpPEd+/W02IMJ1NKt8h66gVbPu5MbJI9dRdF0EyAk5K1bS5y3V6zRFiaDs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 627F71283F; Mon, 23 Oct 2023 07:53:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1698040386; bh=/8koqY7Aal0nobEMJHIW61gixnZqbYo3wzgWfNNFLXM=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To:From; b=a6/ZDZAVwhUK+5OiYottiKBAoKNeu5DZjh2RN432IXEUuAY9z582mBmlyynW+6uU6 835IdG+VnJR7WrB2LgzAX0A5gcoTInwVZDUv45RI3XUzfk5uN0CfbxkAyjrPDrJPDm Kx2rF7Y495BMDxBtiIsMLQZlgseWw2m/OP9WloLB8tgIa0NL4f7Z+iQQHVqxtU7xRk dfqerSDOaLkk+3CUuMJx7+R8jR2jEXfaK2TqT6m4UsSw/fcBxsT1H/OZzlV9DtTPfJ 68IikPyNXThvW9LCJKS0lW7+a1Kp3mWVZxn/mpwC5Na818NhCVFas7VnE1LBbsts7s ffVZqNIfFT1HA== Received: from [IPV6:2001:4dd7:e676:0:eff8:f295:1277:ec60] (2001-4dd7-e676-0-eff8-f295-1277-ec60.ipv6dyn.netcologne.de [IPv6:2001:4dd7:e676:0:eff8:f295:1277:ec60]) (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 cc-smtpin1.netcologne.de (Postfix) with ESMTPSA id 90ACB11D79; Mon, 23 Oct 2023 07:52:57 +0200 (CEST) Message-ID: Date: Mon, 23 Oct 2023 07:52:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] libgfortran: Replace mutex with rwlock Content-Language: en-US, de-DE To: "Zhu, Lipeng" , Bernhard Reutner-Fischer Cc: "fortran@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" , "Lu, Hongjiu" , "Li, Tianyou" , "Deng, Pan" , "Guo, Wangyang" , Jakub Jelinek References: <81c359ae-ab69-7f03-f113-4b865441de44@intel.com> <9e30db8a-2a6f-89d0-84fb-2f549f61954c@intel.com> <93b9e2d5-4355-136a-a961-da1ae9c1468f@netcologne.de> From: Thomas Koenig In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-NetCologne-Spam: L X-Spamd-Bar: - X-Rspamd-Queue-Id: 90ACB11D79 X-Rspamd-Action: no action X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Lipeng, >>> Sure, as your comments, in the patch V6, I added 3 test cases with >>> OpenMP to test different cases in concurrency respectively: >>> 1. find and create unit very frequently to stress read lock and write lock. >>> 2. only access the unit which exist in cache to stress read lock. >>> 3. access the same unit in concurrency. >>> For the third test case, it also help to find a bug: When unit can't >>> be found in cache nor unit list in read phase, then threads will try >>> to acquire write lock to insert the same unit, this will cause duplicate key >> error. >>> To fix this bug, I get the unit from unit list once again before insert in write >> lock. >>> More details you can refer the patch v6. >>> >> >> Could you help to review this update? I really appreciate your assistance. >> > Could you help to review this update? Any concern will be appreciated. Fortran parts are OK (I think I wrote that already), we need somebody for the non-Fortran parts. Jakub, could you maybe take a look? Best regards Thomas