Microsoft Research creates auto-threading compiler

Posted on Tuesday, December 04 2012 @ 17:10 CET by Thomas De Maesschalck
Microsoft logo
Develop in the Cloud reports Microsoft Research has created an experimental C# compiler that can automatically turn single-threaded code into multi-threaded code where the compiler deems it beneficial. The team claims it's written millions of lines of code, creating a web server, an MPEG decoder, and many other applications to test the production use of the compiler. Unfortunately, it's unknown when the company plans to release it.
Recently, Jared Parsons pointed me toward some research (PDF) conducted by Microsoft Research, and accepted for publication at OOPSLA. (Parsons is a co-author.) The team writing the paper also implemented the concepts as an extension to the C# compiler. The key difference between FP and Microsoft's approach is that where FP tries to eliminate mutability, the Microsoft team only tries to track it. One core concept, referred to as reference immutability, in part allows the compiler to track mutability and make decisions about what code can be parallelized and what cannot. The result is a C#-like language that can be written normally (single-threaded), which the compiler auto-threads where it deems it beneficial. This is extremely interesting. It's a game changer. It's also real.

Parsons told me in an email:

In some ways I see FP as kind of an extreme answer to the problem of multi-threading. People find that unexpected state mutations are causing race conditions and they decide the best idea is to eliminate mutable state altogether. I think the the key is making the state mutations visible and controllable.

Loading Comments