views:

31

answers:

1

I need to write a garbage collector for an interpreter that will support concurrency, but I can only find information about garbage collection without anything to do with concurrency.

Are there specific methods for garbage collection of objects in multithreaded systems? Where can I find information on their architecture and implementation?

A: 

Maybe I'm just not understanding this well... But what would concurrency have to do with how many references to an object are alive? It either has living references or it doesn't; multiple threads have no effect on that.

I could see maybe having to trace out each thread separately to see what references are alive or not. But that should be just applying the single-threaded trace multiple times.

Also, why not just program your interpreter on top of a VM that already does all this? Like JRuby (Java VM) or IronPython (.NET) have done.

jdmichal
Different threads may have references to the same object; what options do I have if I don't want to stop all threads when doing GC? (If I don't stop all threads, how can I tell if there are live references to an object or not? One thread may release the object shortly after another one gets a reference to it).
josh
About the VM: I'll have a custom VM (with my own JIT compiling technique, if all goes well)...
josh
@josh I see. You be crazy man. But have fun!
jdmichal