ScalaNative Threads & GC


urrently ScalaNative is single threaded. But we can used POSIX API (for example) to create and manage threads (ans also shared resources).

My questions are related to the garbage collector:

  • is it safe to use scala native and its default GC (immix) with threads ?
    • if the answer is yes. This solution may be not as efficient as expected; is there some benchmarks ?
    • if the answer is no. Is it clever to change the GC to Boehm which is claimed to be concurrent ?


My understanding is that currently neither the Immix or Boehm support multithreading in Scala Native. Multithreaded immix is being worked on right now and is part of the holdup for the topic/multithreading branch (Google summer of code Java/Posix threads implementation) as well as some sort of memory barrier support in the runtime as well but I’m not too knowledgeable in this area. These are probably due in the 0.4.0 release.

I think enabling Boehm would be welcome. If you are interested in Scala Native, I would suggest hanging out on the gitter channel. Denys is the expert and designer and main builder of Scala Native. Tons of cool stuff to work on.

Hope this helps.