RFC: naming for FrontTransversal and Transversal ranges

Robert Jacques sandford at jhu.edu
Sat May 2 01:11:58 PDT 2009


On Sat, 02 May 2009 03:35:51 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> 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));

I'm confused. The article talks about copying the entire data structure,  
not just a node/etc. And trees, etc tend to have variable sizes, etc.

>> 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