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


On Wed, Feb 25, 2004 at 09:26:16PM +0100, Paolo Carlini wrote:
> Paolo Carlini wrote:
> 
> >It's needed something completely different, but basically *every real 
> >world* test on a multi processor machine or in a MT environment can 
> >only be negatively affected by not inlining the operations done at 
> >construction and destruction time.
> 
> Of course non-MT performance is affected too (as soon as you construct 
> and destroy many times, basically, always in the real world ;), only, in 
> that case, one can conceivably remove completely the atomic operations.

Being a non-C++ writer, I'm afraid I can cook up just simple synthetic tests
like which clearly use _M_refcopy and _M_dispose a lot.

#include <string>

using namespace std;

void foo (string &x)
{
}

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

	Jakub


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