RE: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-09-14 Thread Zhu, Lipeng via Fortran
> Hi Thomas, > > > > > Hi Lipeng, > > > > > May I know any comment or concern on this patch, thanks for your > > > time > > > 😄 > > > > Thanks for your patience in getting this reviewed. > > > > A few remarks / questions. > > > > Which strategy is used in this implementation, read-preferring or >

[PATCH v6] libgfortran: Replace mutex with rwlock

2023-08-17 Thread Zhu, Lipeng via Fortran
From: Lipeng Zhu This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache with rwlock instead of the mutex to increase CPU efficiency. In the get_gfc_unit function, the percentage to step into the insert_unit function is around 30%, in most instances, we ca

RE: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-08-17 Thread Zhu, Lipeng via Fortran
Hi Thomas, > > Hi Lipeng, > > > May I know any comment or concern on this patch, thanks for your time > > 😄 > > Thanks for your patience in getting this reviewed. > > A few remarks / questions. > > Which strategy is used in this implementation, read-preferring or write- > preferring? And if

Re: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-05-25 Thread Zhu, Lipeng via Fortran
On 1/1/1970 8:00 AM, Thomas Koenig wrote: Hi Lipeng, May I know any comment or concern on this patch, thanks for your time :) Thanks for your patience in getting this reviewed. A few remarks / questions. Which strategy is used in this implementation, read-preferring or write-preferring

Re: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-05-22 Thread Zhu, Lipeng via Fortran
On 5/16/2023 3:08 PM, Zhu, Lipeng wrote: On 5/9/2023 10:32 AM, Zhu, Lipeng wrote: On 1/1/1970 8:00 AM, Bernhard Reutner-Fischer wrote: On Mon,  8 May 2023 17:44:43 +0800 Lipeng Zhu wrote: This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache

Re: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-05-16 Thread Zhu, Lipeng via Fortran
On 5/9/2023 10:32 AM, Zhu, Lipeng wrote: On 1/1/1970 8:00 AM, Bernhard Reutner-Fischer wrote: On Mon,  8 May 2023 17:44:43 +0800 Lipeng Zhu wrote: This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache with rwlock instead of the mutex to increase

Re: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-05-08 Thread Zhu, Lipeng via Fortran
On 1/1/1970 8:00 AM, Bernhard Reutner-Fischer wrote: On Mon, 8 May 2023 17:44:43 +0800 Lipeng Zhu wrote: This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache with rwlock instead of the mutex to increase CPU efficiency. In the get_gfc_unit functio

Re: [PATCH v3] libgfortran: Replace mutex with rwlock

2023-05-08 Thread Zhu, Lipeng via Fortran
On 1/1/1970 8:00 AM, Bernhard Reutner-Fischer wrote: Hi! [please do not top-post] Sure, thanks for the reminder. On Thu, 20 Apr 2023 21:13:08 +0800 "Zhu, Lipeng" wrote: Hi Bernhard, Thanks for your questions and suggestions. The rwlock could allow multiple threads to have concurrent r

Re: [PATCH v3] libgfortran: Replace mutex with rwlock

2023-04-20 Thread Zhu, Lipeng via Fortran
Hi Bernhard, Thanks for your questions and suggestions. The rwlock could allow multiple threads to have concurrent read-only access to the cache/unit list, only a single writer is allowed. Write lock will not be acquired until all read lock are released. And I didn't change the mutex scope when

RE: [PATCH v2] libgfortran: Replace mutex with rwlock

2023-01-05 Thread Zhu, Lipeng via Fortran
> > Hi Lipeng, > > > > > This patch try to introduce the rwlock and split the read/write to > > > unit_root tree and unit_cache with rwlock instead of the mutex to > > > increase CPU efficiency. In the get_gfc_unit function, the > > > percentage to step into the insert_unit function is around 3

RE: [PATCH v2] libgfortran: Replace mutex with rwlock

2022-12-28 Thread Zhu, Lipeng via Fortran
> Hi Lipeng, > > This patch try to introduce the rwlock and split the read/write to > > unit_root tree and unit_cache with rwlock instead of the mutex to > > increase CPU efficiency. In the get_gfc_unit function, the percentage > > to step into the insert_unit function is around 30%, in most >

[PATCH] libgfortran: Replace mutex with rwlock

2022-12-28 Thread Zhu, Lipeng via Fortran
> libstdc++ implements shared mutex with pthread_rwlock, which can > libstdc++ conflict > with the pthread_rwlock usage in libgcc. Lipeng, please limit the > pthread_rwlock usage in libgcc only when __cplusplus isn't defined. > > > -- > H.J. Thanks for suggestion, send a V2 patch. -- Lipeng