monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Copy-on-write not mandated!


From: Petr Ovtchenkov
Subject: Re: [Monotone-devel] Copy-on-write not mandated!
Date: Tue, 24 Jan 2006 23:44:52 +0300
User-agent: KMail/1.8.3

On Sunday 22 January 2006 15:30, Nathaniel Smith wrote:
> On Sun, Jan 22, 2006 at 08:53:45AM +0100, Clemens Hintze wrote:
> > Sorry for bothering, but - while it is true, that the C++ standard was 
> > written in a manner that allow copy-on-write technics for implementation 
> > of basic_string, it does not mandate to do so!
> > 
> > Further it seems, that there are situations, where copy-on-write will 
> > behave worser than a simple plain implementation - thread safety comes 
> > to mind. See for example
> > 
> >    http://www.gotw.ca/publications/optimizations.htm
> > 
> > In this light it could not being impossible, that STL vendors could 
> > leave the copy-on-write path.
> 
> Yes.  But it happens that
>   1) monotone currently only builds on g++ (or if not, then certainly
>      by far the vast majority of its use is with g++, on all major
>      platforms)
>   2) we know that in fact g++'s std::string is CoW, so can optimize
>      with that in mind
> 
> -- Nathaniel
> 

Well, STLport (http://stlport.sourceforge.net) (default) use non-CoW strings,
and in many cases this approach is better: 
http://complement.sourceforge.net/compare.pdf
IMHO introduction of strings-implementation dependency is bad choice; even
explicit usage of 'ropes' is better...

  - Petr




reply via email to

[Prev in Thread] Current Thread [Next in Thread]