From: Hongli Lai Date: 2008-10-30T05:56:18+09:00 Subject: [ruby-core:19617] Re: GC thought Roger Pack wrote: > Re: objectspace.each_object being bad--I think you could still have > objectspace.each_object with a this patch--it would just have to > synchronize with the GC every time it pulled the "next" object out of > the objectspace--i.e. basically revert to a blocking GC, with the same > drawbacks as those listed above. > Cheers! I actually have thought about aligning the heaps for fast lookup, as you suggested. But it's a bit hard to do that in practice. For example, the APIs for aligned memory allocation are not very portable. As for implementing a concurrent garbage collector, you *need* to have implemented write barriers. There are many papers on garbage collection, and I've noticed that it's pretty much impossible to implement anything more advanced than a simple mark-and-sweep unless you have write barriers.