CCR

Others have blogged about it, others have written technical pieces about it. The Concurrency and Coordination Runtime, which currently forms part of Microsoft Robotics Studio seeks to enable concurrent/parallel programming through the coordination of a lightweight message-passing system.

The CCR (and its distributed big-brother, DSS) represents a shift in thinking for developers like me. Previously, I used to bring my not-inconsiderable (ahem) threading knowledge to a problem, consider the costs of introducing parallelism and weigh-up whether the increased algorithmic complexity was worth the potential runtime improvement.

[Not sure where I read this, but someone once asked if debugging code is harder than writing code, and you're being as clever as you can be when you're writing code, what chance have you of debugging it?]

Spend sometime with the CCR and maybe like me, you'll basically start to worry a lot less about the how and more on the why. And their are plenty of whys:

  1. Multicore hyper-threaded machines are becoming the norm. Most of the new boxes at my place of work have 4 logical processors. We might be ahead of the curve here but I doubt it.
  2. An awful lot of the power of Windows (even in .NET) relies on the developer exploiting the Asynchronous Programming Model (APM) in areas of I/O. You get the best scalability in the back-end this way. On the client, you can build more responsive apps and handle non-UI thread related work on one of those spare processors.
  3. Even in .NET 2.0, this is hard to do, except for the most trivial tasks.

The CCR brings some simplicity to bear. It can allow you to build your apps the way the OS designers really want you to, to get the most of the available power you have, without sacrificing the coherence of your implementation.

I should state from the outset that neither the CCR or DSS runtimes are tied in any way to robotics other than that's how their shipped right now. One day they might ship as part of the BCL but right now, they don't.

I hope to blog some more on the CCR and DSS in the near future, providing some examples of how to exploit its potential within your own (non-robotics) applications.


0 comments: