Garbage Collection



 DEVELOP > c-Plus-Plus > Garbage Collection

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Lasse Skyum lskyumATmail.dk"
Date: 20 Oct 2003 06:40:59 AM
Object: Garbage Collection
Hi folks,
I've been wanting to write a garbagecollector for C++ for a little while...
my idea is that all objects inherited from "CGCObject" will be
garbage-collected if no longer used.
So all I would have to do is:
CMyClass *pTest = new CMyClass(); // CMyClass inherits CGCObject
My aproach has been the "mark and sweep" algorithm, but I haven't been able
to come up with anything where no additional programming is needed for the
programs using CGCObject.
The reason I don't just use reference-counting is because of the possible
cyclic references holding objects alive even though they should have been
deleted.
Can anyone give some hints or references to existing lib's with similar
functionality?
--
Lasse
.

User: "SenderX"

Title: Re: Garbage Collection 20 Oct 2003 06:47:19 AM

I've been wanting to write a garbagecollector for C++ for a little

while...
Too late!
The best garbage collected c++ pointer was already designed a long time ago:
U.S. patent#: 5,295,262

My aproach has been the "mark and sweep" algorithm

Not needed. Ugly schema anyway.

The reason I don't just use reference-counting is because of the possible
cyclic references holding objects alive even though they should have been
deleted.

Na.

Can anyone give some hints or references to existing lib's with similar
functionality?

The one and only lock-free atomic_ptr, created by Joe Seigh:
The C++ version:
http://groups.google.com/groups?selm=3E6B7923.57B88B09%40xemaps.com&rnum=1
The C version( by me ), with ABA prevention code( by me ):
http://appcore.home.comcast.net/src/AtomicPtr.c
This is the best lock-free garbage collector out there. Period!
P.S.
Here is my lock-free proxy garbage collector:
http://intel.forums.liveworld.com/thread.jsp?forum=242&thread=6721
This 100% lock-free garbage collector is almost as good as atomic_ptr...
These lock-free collectors are SMP and HyperThread friendly. "mark and
sweep" is NOT.
;)
--
The designer of the experimental, SMP and HyperThread friendly, AppCore
library.
http://AppCore.home.comcast.net
.
User: "Lasse Skyum lskyumATmail.dk"

Title: Re: Garbage Collection 20 Oct 2003 08:10:24 AM

Too late!

dahh! I'm always too late... born too young I guess :-P
Thanks for the links, they seem verry usefull!
--
Lasse
.



  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER