At PDC 2008 Microsoft launched its Concurrency and Coordination Runtime and Decentralized Software Services Toolkit 2008(CCR & DSS 2008), which is in part a by-product of work for the Microsoft Robotics Developer Studio 2008.
This could be one of the most important announcements Microsoft has made in the parallel programming area. Like the other great hope of parallel programming enthusiasts, Erlang, Microsoft has created a toolkit that uses lightweight threading and message passing to create a new programming model for today's multi-core processors.
The CCR looks straightforward to use and provides a great programming model for concurrency, using the C# yield keyword to great effect to create a continuations-based programming model. Locks are not used: instead, the model is that code doesn't run until all its data dependencies are fulfilled. There is a visual designer (VPL) where the dataflow between services can be modelled; this then generates C# code, which it's claimed is human-readable rather the usual machine-generated spaghetti. The VPL diagram above shows a simple counting service that counts to ten, putting text into an output queue.
The C# message handler code that the VPL generates isn't too bad to deal with, although it's hidden within 20KB of additional code that sets up the service and tears it down. The VPL is fairly powerful and hides of a lot synchronisation from the casual Robotics programmer, but professionals may find that they no longer use it after a few initial projects.
Backing up the CCR is the DSS, which provides distributed networking services that give the whole system robustness and allow the loosely coupled components to be composed. The system provides observability by running as services attached over http, so the state can easily be viewed. Again this ties in with the VPL and allows services to be spread across a network. Services can be auto-started and discovered across the network. The DSS is document-orientated and uses REST for its communications (with both binary and human readable forms).
Although the CCR & DSS have been around and talked about by Microsoft for a couple of years, the original inspiration started around six years ago when Craig Mundie put together a team to work on parallel programming. When the robotics team was set up, they realised that lots of robotics projects had multiple processes and the work performed by the parallel team would be ideal (one example given was the Princeton entry for the Darpa challenge which used five dual-core servers in the back of the vehicle). One problem that they kept running into was that enterprise clients such as Tyco (security networks) and Siemens (sorting the US mail) would come back and say 'we love the product but can we have it without the robotics bit'; and so the toolkit was born.
Performance is still a little unclear, as this runs on both Windows NT and CE which are both general-purpose operating systems. Latency might be an issue although Microsoft says 'in real applications we offer throughputs of several million messages per second, small jitter in the order of a 100s microseconds, and accurate timers with 1ms or below accuracy that gets better as you add core'. Scalability seems to be a much smaller issue: Microsoft has provided customers whitepapers that say that it's a pretty linear scaling with processors — myspace.com uses the system spread across 50,000 servers, so most systems shouldn't have a problem.
Finally, a word about the future: if you need this product today, beware that Microsoft's longer-term plan is to merge it into the main .NET Framework. This may mean that some features get duplicated by new C# language features and get deprecated. However, the core of this programming model hasn't really changed for a couple of years, so much change seems unlikely.
The CCR & DSS toolkit is available for download at a cost of $399 (~£254) per developer seat, which also gives redistribution rights. If you just want to have a play and see if the toolkit can help you, the toolkit without distribution rights is available as part of the Microsoft Robotics Developer Studio, which is currently available as a free CTP download.
This is a sample script for iRobot Create or Roomba.
There is a wide selection of I/O devices and robots.
A simulator showing two robots (Lego & 3DX).
This is the view from the 3DX robot looking towards the table.