From: "David B. Held" <[EMAIL PROTECTED]> > "Beman Dawes" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > [...] > > For a shared-ownership smart pointer with weak_ptr support, I expect > > some people will say that mandates a refcounted rather than reflinked > > implementation. I don't think that is true, but it may make a reflinked > > implementation less attractive. What's your opinion on that? > > I was looking through Peter's GC code, and I see that he builds a > map of pointers. I was wondering if a ref-linked implementation > would make the scan process faster.
Some GCSP implementations do use linked pointers... although they typically keep one big list. This allows them to know precisely where all smart pointers are. The MT downside is that every smart pointer operation needs to grab a global lock. Counted pointers have a per-object mutex. (On a straightforward implementation; synchronization experts may be able to avoid the lock using atomic intructions in one or both cases.) > You could maintain a map of > pointers that would constitute your root set? Then instead of > scanning raw memory, just scan the ref-links? Maybe that's what > Andrei was referring to by the "shared global map approach". Andrei was probably referring to my "design notes" about raw to smart conversions; one solution is to keep a global object pointer to count pointer map. See for example http://web.onetel.net.uk/~anthony_w/cplusplus/genericptr.pdf http://web.onetel.net.uk/~anthony_w/cplusplus/genericptr.zip from http://cplusplus.anthonyw.cjb.net/articles.html _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost