On Apr 9, 4:46 am, Jon Harrop <j...@ffconsultancy.com> wrote:> I am interested in writing simple compilers for high-level programming> languages using LLVM. However, I have been unable to find any concurrent> GCs that could be used like this.>> Where can I find reliable reusable concurrent GC implementations? Does Sun's> open source code include their Java VM's concurrent GC?

Hi Jon,

I don't know offhand if Sun publishes the source to their concurrent
GC, but it would likely not help you even if they did. Hoping someone
will come along and prove me wrong, I'm going to go out on a limb and
say you won't be able to find any easily reusable implementation
anywhere.

Collectors are very tightly bound to the language runtime and are
usually developed in concert with it. LLVM provides hooks around
which to create a collector, but you won't find one that can simply be
dropped in ... it has to be written specifically for the hooks
provided and the language being implemented. It isn't sufficient for
the runtime to simply provide read/write barriers and call hooks - the
collector has to understand all the runtime data structures and user
data types it may encounter and thus it has to be tailored for the
language and runtime implementation. For example, the JVM GC
understands only Java types and the .NET GC understands only CLR types
- any foreign language implemented on those VMs must be translated to
be compatible with their raw type schemes.

There are some decent kits available (such as MPShttp://www.ravenbrook.com/project/mps/) which could help you in
creating your own collector for LLVM, but I'm not aware of any kit
supporting true concurrency out of the box ... serial interleaved
collection is as far as I've seen any kit go. You'd need to do some
significant glue work and figure out the concurrent aspects yourself.

Sorry for the bucket of cold water - I hope somebody else can warm it
up.
George
---
provider is comcast net, user is gneuner2