RFC: naming for FrontTransversal and Transversal ranges

Robert Jacques sandford at jhu.edu
Sat May 2 00:14:12 PDT 2009


On Sat, 02 May 2009 02:34:57 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> Robert Jacques wrote:
>> On Fri, 01 May 2009 19:25:35 -0400, Andrei Alexandrescu  
>> <SeeWebsiteForEmail at erdani.org> wrote:
>>
>>> Robert Jacques wrote:
>>>> Do you have a link to your article?
>>>
>>> http://tinyurl.com/dac82a
>>>
>>>
>>> Andrei
>>  Should've seen that one coming. :)
>>  Anyways, I'm not sure how you can call the technique lock-free, since  
>> you're doing (possibly several) allocations inside the inner CAS loop.
>
> 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);

>> (I guess a good, parallel allocator might negate this) It's probably  
>> not an issue for the article's use case, where reads vastly dominated  
>> updates, but for things like stacks or queues, it wouldn't work. And  
>> poor performance leads people to create their own fast, possibly buggy  
>> versions, thus defeating the point of a standard library.
>
> Incidentally Maged Michael himself wrote the first lock-free malloc().

Cool.

>
>
> Andrei

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. Of course, I  
could be missing something (again).

P.S. A general thank you all your posts and explanations.



More information about the Digitalmars-d mailing list