Newbie initial comments on D language - scope

Walter Bright newshound1 at digitalmars.com
Sat Feb 2 11:01:21 PST 2008


Janice Caron wrote:
> On 2/2/08, Walter Bright <newshound1 at digitalmars.com> wrote:
>> Doing locked reference counts is slow
> 
> Surely you don't need to lock the reference count? You can use atomic
> increment and atomic decrement instead. (I implemented a ref-counted
> template in C++ once, and that's what I did. It seemed to work).

Doing atomic inc/dec *is* locking. The LOCK CPU instruction is there, 
but it's mighty slow.



More information about the Digitalmars-d mailing list