Re: [boost] [xint] Boost.XInt formal review

----- "DE" <satan66613@yandex.ru> a écrit :
on 07.03.2011 at 9:17 Jeffrey Lee Hellrung, Jr. wrote :
Another concern with COW in general is iterator invalidation. Either your iterator gets "fatter" and slower (e.g., by being implemented as a pointer to the object + offset), or you expand the class of operations that invalidate iterators beyond just resizing operations to *any* modification operation (compared to a class which does not use COW).
been the cow atomically ref counted you will NEVER notice it's there
I can't wait for the day "atomic free" will be a marketing point, just like "lock free" is today.
think of it: if an operation requires reallocation of the storage then anyway iterators are invalidated
Without COW, the iterators used in another thread are not invalidated, since no data is shared. Anyway, this whole thing sums up to: let me choose the container that suits my needs. Ivan

On Mon, 7 Mar 2011 12:02:43 +0100 (CET) Ivan Le Lann <ivan.lelann@free.fr> wrote:
[...] think of it: if an operation requires reallocation of the storage then anyway iterators are invalidated
Without COW, the iterators used in another thread are not invalidated, since no data is shared.
Even with it, no client-code-accessible data is generally shared.
Anyway, this whole thing sums up to: let me choose the container that suits my needs.
I plan to, in an upcoming version. -- Chad Nelson Oak Circle Software, Inc. * * *

on 07.03.2011 at 14:02 Ivan Le Lann wrote :
Without COW, the iterators used in another thread are not invalidated, since no data is shared.
Anyway, this whole thing sums up to: let me choose the container that suits my needs.
either of us don't understand what we are talking about suppose we have two cow implemented objects in different threads sharing exactly the same data lets assume that the ref counting is not atomic and to be fair that only one thread modifies its object then thread#1 thread#2 object a; object b; //object share the same data //"slim" iterators point to exactly the same data iterator i = a.begin(); interator i = b.begin(); //a is not modified and b.modify(); //modifying 'b' so its //the iterator is still //iterator in this thread is //valid in this thread //invalid now in thread#2 'b' gets new storage so the declared iterator invalidates but 'a' in thread#1 even after 'b' is modified still holds the same data so there is no reason for iterator to be invalidated i see no problems with iterators here what do i miss? -- Pavel P.S. if you notice a grammar mistake or weird phrasing in my message please point it out
participants (3)
-
Chad Nelson
-
DE
-
Ivan Le Lann