[PATCH] libgfortran: Replace mutex with rwlock

2022-12-28 Thread Zhu, Lipeng via Gcc-patches
> 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. --

Re: [PATCH] libgfortran: Replace mutex with rwlock

2022-12-27 Thread H.J. Lu via Gcc-patches
On Sun, Dec 25, 2022 at 4:58 PM Steve Kargl via Gcc-patches wrote: > > On Wed, Dec 21, 2022 at 07:27:11PM -0500, Lipeng Zhu via Fortran 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] libgfortran: Replace mutex with rwlock

2022-12-25 Thread Steve Kargl via Gcc-patches
On Wed, Dec 21, 2022 at 07:27:11PM -0500, Lipeng Zhu via Fortran 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 function, the percentage > to step into

[PATCH] libgfortran: Replace mutex with rwlock

2022-12-20 Thread Lipeng Zhu via Gcc-patches
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 can get the unit in

[PATCH] libgfortran: Replace mutex with rwlock

2022-12-20 Thread Lipeng Zhu via Gcc-patches
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 can get the unit in