Subj : Re: A question about atomic_ptr To : comp.programming.threads From : Joe Seigh Date : Tue Apr 12 2005 02:18 pm On Mon, 11 Apr 2005 19:25:02 -0700, Chris Thomasson <_no_damn_spam_cristom@_no_damn_comcast.net_spam> wrote: > > > > >> There seems to be some attraction in c.l.c++.m to smart pointers that >> have almost no overhead, the deferred reference counting being >> promoted by Andrei but there's no such thing a a free lunch. Deferred >> reference counting does Boehm style GC against the thread stacks and >> that requires a "stop the world while we GC" which has huge performance >> implications in multi-threading. > > Actually, you mentioned a scheme that would allow for "deferred reference > counting" using per-thread lock-free single-producer/consumer queues. > Pushing a node ( reference adjustment request ) into a "local" per-thread > queue is certainly less overhead than performing an interlocked-operation on > a "shared" variable. I don't think you would need to use DWCAS either. The > logic could be isolated in the "collection phase"... > > There is just one problem, if the collection cycles could not keep up with > user allocs/frees the applications memory usage could climb out of control. > > The deferred reference counting mentioned by Andrei seems to be a different scheme. I think there's a way to solve most of the problems here. I'll just add it to my list of things I don't have time to do. Actually, I have time, just not time to do pointless things. I mean, just how many more GC schemes do *I* need? -- Joe Seigh .