Quote: Original post by WitchLord
I need to resolve potential circular references with the introduction of script structures, and I believe a GC is the easiest way to do this. Doing what you said with having the release method search for circular references, seems to be complicated and kind of backwards. I could be wrong, but this is what I feel.
Hmm, why do you feel this way? The algorithm is almost the same in all cases anyway, all you do is walk the graph. Regardless of which method you choose, you might want to look into using boost graph library. Most of the code is already written for you in a generic manner! [smile] I'm not sure how these cases are different, I feel they're almost the same... Also, you don't need to walk the graph on every release call, you can just add objects in question to an internal container for later examination.
Quote: Original post by WitchLord
I'd like to learn more about Python's way of doing it. Do you have an article you recommend?
Here's a good one. It's a bit sparse on the details but it's a start.
Also google scholar is priceless. You'll have to read through a lot of convoluted ideas you can't use but you can pick up a lot of ideas along the way.
Quote: Original post by WitchLord
I'm also slightly worried about multithreading, and how that impacts the garbage collection.
I think you'll run into the same problems with either method. I haven't gone through this yet so I can't really give much useful advice [smile]