Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-20 Thread Jonathan Wakely via Gcc-patches
On 20/04/21 15:25 +0100, Jonathan Wakely wrote: On 20/04/21 12:41 +0100, Jonathan Wakely wrote: On 20/04/21 12:04 +0100, Jonathan Wakely wrote: On 19/04/21 12:23 -0700, Thomas Rodgers wrote: From: Thomas Rodgers This patch address jwakely's feedback from 2021-04-15. This is a substantial

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-20 Thread Jonathan Wakely via Gcc-patches
On 20/04/21 12:41 +0100, Jonathan Wakely wrote: On 20/04/21 12:04 +0100, Jonathan Wakely wrote: On 19/04/21 12:23 -0700, Thomas Rodgers wrote: From: Thomas Rodgers This patch address jwakely's feedback from 2021-04-15. This is a substantial rewrite of the atomic wait/notify (and timed wait

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-20 Thread Jonathan Wakely via Gcc-patches
On 19/04/21 12:23 -0700, Thomas Rodgers wrote: +#if __cpp_lib_atomic_wait + struct __atomic_semaphore + { +static constexpr ptrdiff_t _S_max = __gnu_cxx::__int_traits::__max; +explicit __atomic_semaphore(__detail::__platform_wait_t __count) noexcept + : _M_counter(__count) { -

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-20 Thread Jonathan Wakely via Gcc-patches
On 19/04/21 12:23 -0700, Thomas Rodgers wrote: +struct __timed_backoff_spin_policy +{ + __wait_clock_t::time_point _M_deadline; + __wait_clock_t::time_point _M_t0; + + template + __timed_backoff_spin_policy(chrono::time_point<_Clock, _Dur> +

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-20 Thread Jonathan Wakely via Gcc-patches
On 20/04/21 14:20 +0100, Jonathan Wakely wrote: On 20/04/21 13:02 +0100, Jonathan Wakely wrote: On 19/04/21 12:23 -0700, Thomas Rodgers wrote: + template + static bool + _S_do_spin_v(__platform_wait_t* __addr, + const _Up& __old, _ValFn __vfn, +

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-20 Thread Jonathan Wakely via Gcc-patches
On 20/04/21 13:02 +0100, Jonathan Wakely wrote: On 19/04/21 12:23 -0700, Thomas Rodgers wrote: + template + static bool + _S_do_spin_v(__platform_wait_t* __addr, + const _Up& __old, _ValFn __vfn, + __platform_wait_t& __val, +

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-20 Thread Jonathan Wakely via Gcc-patches
On 19/04/21 12:23 -0700, Thomas Rodgers wrote: + template + static bool + _S_do_spin_v(__platform_wait_t* __addr, + const _Up& __old, _ValFn __vfn, + __platform_wait_t& __val, + _Spin __spin = _Spin{ }) +

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-20 Thread Jonathan Wakely via Gcc-patches
On 20/04/21 12:04 +0100, Jonathan Wakely wrote: On 19/04/21 12:23 -0700, Thomas Rodgers wrote: From: Thomas Rodgers This patch address jwakely's feedback from 2021-04-15. This is a substantial rewrite of the atomic wait/notify (and timed wait counterparts) implementation. The previous

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-20 Thread Jonathan Wakely via Gcc-patches
On 19/04/21 12:23 -0700, Thomas Rodgers wrote: From: Thomas Rodgers This patch address jwakely's feedback from 2021-04-15. This is a substantial rewrite of the atomic wait/notify (and timed wait counterparts) implementation. The previous __platform_wait looped on EINTR however this behavior

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-20 Thread Jonathan Wakely via Gcc-patches
On 19/04/21 12:23 -0700, Thomas Rodgers wrote: namespace __detail { -using __platform_wait_t = int; - -constexpr auto __atomic_spin_count_1 = 16; -constexpr auto __atomic_spin_count_2 = 12; - -template - inline constexpr bool __platform_wait_uses_type #ifdef

[PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-19 Thread Thomas Rodgers
From: Thomas Rodgers This patch address jwakely's feedback from 2021-04-15. This is a substantial rewrite of the atomic wait/notify (and timed wait counterparts) implementation. The previous __platform_wait looped on EINTR however this behavior is not required by the standard. A new

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-15 Thread Jonathan Wakely via Gcc-patches
On 23/03/21 12:00 -0700, Thomas Rodgers wrote: From: Thomas Rodgers * This patch addresses jwakely's previous feedback. * This patch also subsumes thiago.macie...@intel.com 's 'Uncontroversial If this part is intended as part of the commit msg let's put Thiago's name rather than email

[PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-03-23 Thread Thomas Rodgers
From: Thomas Rodgers * This patch addresses jwakely's previous feedback. * This patch also subsumes thiago.macie...@intel.com 's 'Uncontroversial improvements to C++20 wait-related implementation'. * This patch also changes the atomic semaphore implementation to avoid checking for any

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-03-03 Thread Jonathan Wakely via Gcc-patches
On 23/02/21 13:57 -0800, Thomas Rodgers wrote: From: Thomas Rodgers * This revises the previous version to fix std::__condvar::wait_until() usage. This is a substantial rewrite of the atomic wait/notify (and timed wait counterparts) implementation. The previous __platform_wait looped on

Re: [PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-03-03 Thread Jonathan Wakely via Gcc-patches
On 23/02/21 13:57 -0800, Thomas Rodgers wrote: diff --git a/libstdc++-v3/include/bits/atomic_wait.h b/libstdc++-v3/include/bits/atomic_wait.h index 1a0f0943ebd..fa83ef6c231 100644 --- a/libstdc++-v3/include/bits/atomic_wait.h +++ b/libstdc++-v3/include/bits/atomic_wait.h @@ -39,17 +39,16 @@

[PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-02-23 Thread Thomas Rodgers
From: Thomas Rodgers * This revises the previous version to fix std::__condvar::wait_until() usage. This is a substantial rewrite of the atomic wait/notify (and timed wait counterparts) implementation. The previous __platform_wait looped on EINTR however this behavior is not required by the

[PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-02-22 Thread Thomas Rodgers
From: Thomas Rodgers This is a substantial rewrite of the atomic wait/notify (and timed wait counterparts) implementation. The previous __platform_wait looped on EINTR however this behavior is not required by the standard. A new _GLIBCXX_HAVE_PLATFORM_WAIT macro now controls whether wait/notify