Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 11:09 PM Jonathan Wakely wrote: > On Thu, 5 Jun 2025 at 18:58, Tomasz Kaminski wrote: > > > > > > > > On Thu, Jun 5, 2025 at 6:44 PM Jonathan Wakely > wrote: > >> > >> On Thu, 5 Jun 2025 at 15:42, Tomasz Kaminski > wrote: > >> > > >> > > >> > > >> > On Thu, Jun 5, 2025 a

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Jonathan Wakely
On Thu, 5 Jun 2025 at 18:58, Tomasz Kaminski wrote: > > > > On Thu, Jun 5, 2025 at 6:44 PM Jonathan Wakely wrote: >> >> On Thu, 5 Jun 2025 at 15:42, Tomasz Kaminski wrote: >> > >> > >> > >> > On Thu, Jun 5, 2025 at 12:41 PM Jonathan Wakely wrote: >> >> >> >> On Thu, 5 Jun 2025 at 10:00, Tomasz

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 6:44 PM Jonathan Wakely wrote: > On Thu, 5 Jun 2025 at 15:42, Tomasz Kaminski wrote: > > > > > > > > On Thu, Jun 5, 2025 at 12:41 PM Jonathan Wakely > wrote: > >> > >> On Thu, 5 Jun 2025 at 10:00, Tomasz Kaminski > wrote: > >> > > >> > > >> > > >> > On Thu, Jun 5, 2025 a

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Jonathan Wakely
On Thu, 5 Jun 2025 at 15:42, Tomasz Kaminski wrote: > > > > On Thu, Jun 5, 2025 at 12:41 PM Jonathan Wakely wrote: >> >> On Thu, 5 Jun 2025 at 10:00, Tomasz Kaminski wrote: >> > >> > >> > >> > On Thu, Jun 5, 2025 at 12:06 AM Jonathan Wakely wrote: >> >> >> >> Rename __semaphore_base to __semaph

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 12:41 PM Jonathan Wakely wrote: > On Thu, 5 Jun 2025 at 10:00, Tomasz Kaminski wrote: > > > > > > > > On Thu, Jun 5, 2025 at 12:06 AM Jonathan Wakely > wrote: > >> > >> Rename __semaphore_base to __semaphore_impl, because it's not used as a > >> base class. Replace the th

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Jonathan Wakely
On Thu, 5 Jun 2025 at 10:00, Tomasz Kaminski wrote: > > > > On Thu, Jun 5, 2025 at 12:06 AM Jonathan Wakely wrote: >> >> Rename __semaphore_base to __semaphore_impl, because it's not used as a >> base class. Replace the three identical lambda expressions with a named >> class, __semaphore_impl::_

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Jonathan Wakely
On Thu, 5 Jun 2025 at 11:41, Jonathan Wakely wrote: > > On Thu, 5 Jun 2025 at 10:00, Tomasz Kaminski wrote: > > > > > > > > On Thu, Jun 5, 2025 at 12:06 AM Jonathan Wakely wrote: > >> > >> Rename __semaphore_base to __semaphore_impl, because it's not used as a > >> base class. Replace the three

Re: [PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-05 Thread Tomasz Kaminski
On Thu, Jun 5, 2025 at 12:06 AM Jonathan Wakely wrote: > Rename __semaphore_base to __semaphore_impl, because it's not used as a > base class. Replace the three identical lambda expressions with a named > class, __semaphore_impl::_Can_acquire, which stores the most recent > value of the counter a

[PATCH 1/2] libstdc++: Optimize std::counting_semaphore for futex path

2025-06-04 Thread Jonathan Wakely
Rename __semaphore_base to __semaphore_impl, because it's not used as a base class. Replace the three identical lambda expressions with a named class, __semaphore_impl::_Can_acquire, which stores the most recent value of the counter as a data member. Add a new __platform_semaphore_impl class templ