Newbie initial comments on D language - scope

Janice Caron caron800 at googlemail.com
Sat Feb 2 10:25:18 PST 2008


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

Locking the indirect object itself - that's another matter! However,
one would imagine that multithreaded code which shares objects will
already have a mutex system in place, because that would have been
needed even without ref counting.



More information about the Digitalmars-d mailing list