This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] libstdc++ atomicity, x86 agnostic version


Benjamin Kosnik wrote:

Using Jakub's test:

#include <string>

using namespace std;

bool b = true;
const string s = "abc";

void foo(string &x)
{ }

int main (void)
{
for (int i = 0; i < 10000000; ++i)
{
string t = s;
foo(t);
}
}


Well, it looks like part of the test is bogus (sorry Jakub!) since the argument x of foo is a reference and therefore no constructions and destructions take place...

I get:

%time ./gcc-3.4-atomic.exe
1.740u 0.000s 0:01.79 97.2% 0+0k 0+0io 166pf+0w
1.750u 0.000s 0:01.76 99.4% 0+0k 0+0io 166pf+0w
<bkoz@roscoe> /home/bkoz/string_tests %time ./gcc-3.4.exe
1.560u 0.010s 0:01.59 98.7% 0+0k 0+0io 165pf+0w
1.580u 0.000s 0:01.59 99.3% 0+0k 0+0io 165pf+0w
<bkoz@roscoe> /home/bkoz/string_tests %time ./gcc-3.3.2.exe
1.660u 0.000s 0:01.67 99.4% 0+0k 0+0io 203pf+0w
1.650u 0.000s 0:01.66 99.3% 0+0k 0+0io 203pf+0w


I see. Seems something reasonable for 3.4...

However, I would really like to carry out some tests myself (also in the light of the observation above): unfortunately, after having applied your patch and regenerated everything (aclocal - autoconf - autoheader - automake from the top libstdc++-v3 dir) I'm getting:

make[3]: Leaving directory `/home/paolo/Gcc/cvs-dirs/gcc-head-build/i686-pc-linux-gnu/libstdc++-v3'
Making all in include
make[3]: Entering directory `/home/paolo/Gcc/cvs-dirs/gcc-head-build/i686-pc-linux-gnu/libstdc++-v3/include'
make[3]: *** No rule to make target `/home/paolo/Gcc/cvs-dirs/gcc-head/gcc/libstdc++-v3/include/bits/atomicity.h', needed by `stamp-bits'.
Stop.
make[3]: Leaving directory `/home/paolo/Gcc/cvs-dirs/gcc-head-build/i686-pc-linux-gnu/libstdc++-v3/include'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/paolo/Gcc/cvs-dirs/gcc-head-build/i686-pc-linux-gnu/libstdc++-v3'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/paolo/Gcc/cvs-dirs/gcc-head-build/i686-pc-linux-gnu/libstdc++-v3'
make: *** [all-target-libstdc++-v3] Error 2


What I'm doing wrong?

Thanks,
Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]