"David B. Held" wrote:
> 
> "Pavel Vasiliev" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > [...]
> > In my implementation of refc_ptr operator= performs
> > incrementing/decrementing within a single guarded section (since
> > the only global instance of interl. op. mutex is used for all
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> > cases). So the copying via operator= is about twice faster in my
> > implementation. 

Really? What about contention? Well, it's a nice way to play 
ping-pong on a multiprocessor system... or am I just missing 
and/or misunderstanding something?

> > I do not know how to achieve this with
> > Loki::SmartPtr.
> >
> > The true locking/unlocking, not InterlockedIncrement/Decrement()
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Nah, pthread_refcount_t. ;-)

> > even if availabe, is necessary to support weak references.
> > [...]
> 
> Well, this is a good point, and is worthy of study at some point.

It's probably a bit more exciting to take care of all possible races 
without "a true lock" protecting both counters. I'm not sure that the
true locking is *necessary* to support weak references. Do you have
an illustration, Pavel?

regards,
alexander.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to