Re: my garbage collector sucks

"Mark Hahn" <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
Mark Hahn wrote:

> Unless anyone can come up with any other ideas I will go to the Python
> reference counter scheme, even though I hate having to keep track of
> the reference count in my C code.  Someone please save me!
>
> At the rate I'm going I'm going to end up reinventing Python!

Maybe not after all.

I've spent some time today researching garbage collectors and I find that my
algorithm is just a amateur under-designed one.  There are many advanced
techniques to solve my cache problem.

1) Generational algorithms can let the mark-sweep operate on only a small
subset of the objects (the young ones).

2) There are tricks to keep the object state info seperate from the objects
and in compact form to use less cache space.

3) There are tricks to not actually delete an object until it is ready to be
reused so that it would need to be in the cache anyway.

I have also found out that reference counting has problems with
multi-processor systems and distributed systems.  Since Prothon uses real OS
threads and has high hopes for multi-CPU systems, I shouldn't switch to
reference counting too quickly.

I was also impressed in my reading by how advanced my continuous garbage
collector was considered.  Working with threads and scaling with
multiple-cpus was considered to be a big challenge for garbage collectors
and my current approach (with my locking objects) does that well already.
All I have to do now is fix the suckiness with respect to cache behavior.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.