Concurrent paths of execution in Truffle languages

Chris Seaton chris.seaton at oracle.com
Wed Feb 4 14:38:14 UTC 2015


Hello Joerg,

This is no particular recommended technique at the moment, and it’s an area still open for good ideas. We are researching a wide range of approaches for both concurrency and parallelism in languages such as JS and Ruby, but there isn’t any support yet built into Truffle.

The only exception is there is some support for atomically modifying an AST, by using the Node#atomic method: http://lafo.ssw.uni-linz.ac.at/javadoc/graalvm/all/index.html?com/oracle/truffle/api/test/package-summary.html.

Goroutines in particular are a little challenging as people expect to be able to create millions of them, but the JVM is not tuned to create millions of threads so we need a different approach than simply creating a Java thread for each goroutine. There are similar challenges for Haskell’s IO threads, Ruby’s Fiber class, and Erlang’s processes. One option might be to add coroutine support to the JVM, and we have patches for that but nothing being actively worked on as far as I know.

Chris

> On 3 Feb 2015, at 20:54, jwin <jwin1968 at gmail.com> wrote:
> 
> Hi,
> 
> Is there any recommended way to implement concurrent AST interpretation ?
> Implementing concurrency features in aTruffle language would be a nice feature.
> 
> I'm not talking about utilizing any concurrency feature of the host language for AST interpretation.
> What I mean is something to implement things like go-blocks in a Truffle language....
> 
> Regards,
> Joerg
> 



More information about the graal-dev mailing list