[LLVMdev] GC in multithreaded (but with no shared state) environment

Jon Harrop jonathandeanharrop at googlemail.com
Mon Feb 17 02:31:07 PST 2014


I already did this for HLVM. Check it out:

http://www.ffconsultancy.com/ocaml/hlvm/

Note that I used per-thread shadow stacks but none of the LLVM GC support.
I used a technique similar to Henderson's accurate garbage collection in an
uncooperative environment.

Parallel performance was extremely good:

http://flyingfrogblog.blogspot.com/2010/01/naive-parallelism-with-hlvm.html

HLVM can be faster than Java, Haskell, OCaml, MLton and almost as fast as
C/C++:

http://flyingfrogblog.blogspot.com/2010/01/hlvm-on-ray-tracer-language-comparison.html

The design of HLVM is very simple. The GC that handles concurrent mutators
is only 100 lines of code. The entire garbage collected VM is only 2,000
lines of OCaml code.

Cheers,
Jon.

On Mon, Feb 17, 2014 at 7:27 AM, Paweł Batko <pawel.batko at gmail.com> wrote:

> Hi all,
>
> I would like to implement GC for a language supporting multiple threads.
> There will be no shared state between threads as communication will be
> based on message passing. I do not care much about performance. The
> priority for me is to get things working.
>
> I have read LLVM guide on writing GC:
> http://llvm.org/docs/GarbageCollection.html. Shadow stack approach looks
> very promising. The problem is, as described in the guide, shadow stack is
> single thread solution. It would be ideal if I could get LLVM to create a
> shadow stack on per thread basis. How could this be achieved?
>
> Thanks,
> Paweł.
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140217/bdab0957/attachment.html>


More information about the llvm-dev mailing list