[LLVMdev] open source multithreaded garbage collector suitable for LLVM applications?
Talin
viridia at gmail.com
Sat May 2 01:05:35 PDT 2009
Chris Lattner wrote:
> On May 1, 2009, at 1:27 PM, Basile STARYNKEVITCH wrote:
>> Hello All
>>
>> Does any know about some opensource multithread-compatible (or
>> concurrent) garbage collector library, if possible suitable for LLVM?
> In fact, yes!
> http://code.google.com/p/scarcity/
Note that this is still a work in progress, and not quite ready for use
in real programs. But yes, the goal is to create a concurrent garbage
collector (or actually, several different collectors) for LLVM projects.
The project philosophy is based around the "building blocks" idea that
was discussed earlier in this list. By Using C++ policy-based design,
Scarcity intends to provide essential components for building garbage
collectors. The policy-based approach allows any aspect of the system to
easily be replaced - so for example you can replace all of the threading
primitives with ones that are specific to your runtime environment.
Policies also allow the collector to be adapted to different object
memory layouts without requiring the overhead of virtual method calls.
The ConcurrentCollector class supports both "stop the world" and
"sliding window" collection algorithms via subclassing - it provides a
framework for synchronization between mutator threads and the collector,
and it's up to the subclass to determine exactly what happens at each
sync point. This means that there is room for a lot of different
multithreaded collector algorithms to be implemented within this framework.
Anyway, there is lots to be done still. I have not even begun to work on
the integration with LLVM proper.
-- Talin
More information about the llvm-dev
mailing list