RFC: naming for FrontTransversal and Transversal ranges

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat May 2 00:35:51 PDT 2009


Robert Jacques wrote:
>> No, repeated allocations are trivial to eliminate. I didn't even 
>> bother to explain that in the article. The loop must only refill the 
>> allocated object from the object that needs to be replaced.
> 
> putting the test in the pseudo code for this would've help my 
> understanding.
> 
> if(copy is null)
>     copy = s.deepDup;
> else
>     s.deepDupTo(copy);

copy = cast(T*) GC.malloc(T.sizeof);
do {
     overwrite(s, copy);
     copy.modify;
} while (!cas(copy, s));

> But Andrei, I really don't care about the existence of a lock-free 
> algorithm with value semantics. I only care about a practical lock-free 
> algorithm with value semantics. This approach, while elegant in its 
> simplicity and good for some situations, is very poor at high update / 
> contention objects, like stacks and queues. Maybe, locked algorithms are 
> the best value semantics can do in some situations and this might result 
> in separate fast reference containers. Which is a drawback to value 
> semantics and should be placed into the big pros/cons pile.

I agree.


Andrei



More information about the Digitalmars-d mailing list