Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-02-01 Thread Jonathan Wakely
One more patch to fix the preprocessor conditions, this time to fix --disable-threads builds. Tested x86_64-linux, committed to trunk. commit 911783907e5482c09d80fd8a5e3b5aa6d2b891d3 Author: Jonathan Wakely Date: Sat Jan 31 22:01:43 2015 + * src/c++11/futex.cc: Do not define for gthr

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-28 Thread Doug Gilmore
On 01/18/2015 05:19 AM, Jonathan Wakely wrote: > On 17/01/15 19:51 -0700, Sandra Loosemore wrote: >> On 01/17/2015 03:58 PM, Jonathan Wakely wrote: >>> >>> My fault, this additional chunk is needed alongside the patch I sent >>> earlier: >>> >>> --- a/libstdc++-v3/include/bits/atomic_futex.h >>> ++

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-18 Thread Jonathan Wakely
On 16/01/15 18:00 +0100, Torvald Riegel wrote: +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + bool + __atomic_futex_unsigned_base::_M_futex_wait_until(unsigned *__addr, + unsigned __val, + bool __has_timeout, chrono::seconds __s, chrono::nanosecon

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-18 Thread Jonathan Wakely
On 18/01/15 13:19 +, Jonathan Wakely wrote: On 17/01/15 19:51 -0700, Sandra Loosemore wrote: On 01/17/2015 03:58 PM, Jonathan Wakely wrote: My fault, this additional chunk is needed alongside the patch I sent earlier: --- a/libstdc++-v3/include/bits/atomic_futex.h +++ b/libstdc++-v3/inclu

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-18 Thread Jonathan Wakely
On 17/01/15 19:51 -0700, Sandra Loosemore wrote: On 01/17/2015 03:58 PM, Jonathan Wakely wrote: My fault, this additional chunk is needed alongside the patch I sent earlier: --- a/libstdc++-v3/include/bits/atomic_futex.h +++ b/libstdc++-v3/include/bits/atomic_futex.h @@ -35,7 +35,7 @@ #include

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-17 Thread Sandra Loosemore
On 01/17/2015 03:58 PM, Jonathan Wakely wrote: My fault, this additional chunk is needed alongside the patch I sent earlier: --- a/libstdc++-v3/include/bits/atomic_futex.h +++ b/libstdc++-v3/include/bits/atomic_futex.h @@ -35,7 +35,7 @@ #include #include #include -#if !defined(_GLIBCXX_HAVE_

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-17 Thread Jonathan Wakely
On 17/01/15 15:54 -0700, Sandra Loosemore wrote: On 01/17/2015 03:36 PM, Jonathan Wakely wrote: On 17/01/15 15:22 -0700, Sandra Loosemore wrote: [snip snip] I'm getting a different series of build errors with this patch -- starting with In file included from /scratch/sandra/arm-fsf2/src/gcc-ma

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-17 Thread Sandra Loosemore
On 01/17/2015 03:36 PM, Jonathan Wakely wrote: On 17/01/15 15:22 -0700, Sandra Loosemore wrote: [snip snip] I'm getting a different series of build errors with this patch -- starting with In file included from /scratch/sandra/arm-fsf2/src/gcc-mainline/libstdc++-v3/src/c++11/futex.cc:27:0: /scr

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-17 Thread Jonathan Wakely
On 17/01/15 15:22 -0700, Sandra Loosemore wrote: On 01/17/2015 01:23 PM, Jonathan Wakely wrote: On 17/01/15 12:59 -0700, Sandra Loosemore wrote: Re: On 17/01/15 01:45 -0500, Hans-Peter Nilsson wrote: On Fri, 16 Jan 2015, pins...@gmail.com wrote: On Jan 16, 2015, at 9:57 PM, David Edelsohn

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-17 Thread Sandra Loosemore
On 01/17/2015 01:23 PM, Jonathan Wakely wrote: On 17/01/15 12:59 -0700, Sandra Loosemore wrote: Re: On 17/01/15 01:45 -0500, Hans-Peter Nilsson wrote: On Fri, 16 Jan 2015, pins...@gmail.com wrote: On Jan 16, 2015, at 9:57 PM, David Edelsohn wrote: This patch has broken bootstrap on AIX Ma

Re: Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-17 Thread Jonathan Wakely
On 17/01/15 12:59 -0700, Sandra Loosemore wrote: Re: On 17/01/15 01:45 -0500, Hans-Peter Nilsson wrote: On Fri, 16 Jan 2015, pins...@gmail.com wrote: On Jan 16, 2015, at 9:57 PM, David Edelsohn wrote: This patch has broken bootstrap on AIX May I mention that this really should have been te

Re: Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-17 Thread Sandra Loosemore
Re: On 17/01/15 01:45 -0500, Hans-Peter Nilsson wrote: On Fri, 16 Jan 2015, pins...@gmail.com wrote: > On Jan 16, 2015, at 9:57 PM, David Edelsohn wrote: > > This patch has broken bootstrap on AIX > > May I mention that this really should have been tested on systems > other than x86 Linux. I

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-17 Thread Jonathan Wakely
On 17/01/15 01:45 -0500, Hans-Peter Nilsson wrote: On Fri, 16 Jan 2015, pins...@gmail.com wrote: > On Jan 16, 2015, at 9:57 PM, David Edelsohn wrote: > > This patch has broken bootstrap on AIX > > May I mention that this really should have been tested on systems > other than x86 Linux. It also

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-17 Thread Jonathan Wakely
On 17 January 2015 at 06:45, Hans-Peter Nilsson wrote: > On Fri, 16 Jan 2015, pins...@gmail.com wrote: >> > On Jan 16, 2015, at 9:57 PM, David Edelsohn wrote: >> > >> > This patch has broken bootstrap on AIX >> > >> > May I mention that this really should have been tested on systems >> > other th

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-16 Thread Hans-Peter Nilsson
On Fri, 16 Jan 2015, pins...@gmail.com wrote: > > On Jan 16, 2015, at 9:57 PM, David Edelsohn wrote: > > > > This patch has broken bootstrap on AIX > > > > May I mention that this really should have been tested on systems > > other than x86 Linux. > > It also broke all newlib targets too. So you c

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-16 Thread pinskia
> On Jan 16, 2015, at 9:57 PM, David Edelsohn wrote: > > This patch has broken bootstrap on AIX > > May I mention that this really should have been tested on systems > other than x86 Linux. It also broke all newlib targets too. So you could have tested one listed in the sim-test web page.

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-16 Thread David Edelsohn
This patch has broken bootstrap on AIX May I mention that this really should have been tested on systems other than x86 Linux. In file included from /tmp/20150117/powerpc-ibm-aix7.1.0.0/libstdc++-v3/include/ future:44:0, from /nasfarm/edelsohn/src/src/libstdc++-v3/src/c++11/compa

Re: [patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-16 Thread Jonathan Wakely
On 16/01/15 18:00 +0100, Torvald Riegel wrote: OK for trunk? OK, thanks.

[patch libstdc++] Optimize synchronization in std::future if futexes are available.

2015-01-16 Thread Torvald Riegel
This patch optimizes synchronization in std::future by using atomic operations and futexes if the latter are available, instead of the mutex/condvar combination in the existing code. That reduces the space overhead for futexes as well as synchronization runtime overheads. To do that, the patch in