CCR API Overview

Microsoft Robotics

Glossary Item Box

Microsoft Robotics Developer StudioSend feedback on this topic

CCR API Overview

Concurrency and Coordination Runtime (CCR) implementation has three main categories of functionality:

  1. The Port and PortSet queueing primitives, see CCR Ports and PortSets. The Port class is a first in first out (FIFO) queue of items - an item can be any valid Common Language Runtime (CLR) type (only items of that type, either CLR base types or user-defined types, can be posted to the port). In most cases there is also a queue of receivers (user code "guarded" by an Arbiter, which means that the Arbiter controls the execution of tasks by filtering the incoming messages as appropriate).
  2. The coordination primitives also called Arbiters, see CCR Coordination Primitives. These are classes that execute user code, often a delegate to some method (which might be anonymous), when certain conditions are met. The primitives can be nested and can also be extended by the programmer.
  3. The Dispatcher, DispatcherQueue and Task primitives, see CCR Task Scheduling. The CCR isolates the scheduling and load balancing logic from the rest of the implementation by using these classes to abstract how user tasks execute, what they contain, and on what resources they will run. CCR avoids a single, process wide execution resource, like the Common Language Runtime thread pool and instead allows the programmer to have multiple, completely isolated pools of OS threads that abstract any notion of threading behind them. (Unlike the CLR, the CCR thread pools are fixed in size at the time of creation and threads are not dynamically added or removed which makes CCR more efficient at managing threads). In the most common case, hundreds of software components can share just a single Dispatcher resource which can load balance millions of tasks across some small number of OS threads. The DispatcherQueue class is the only way to interact with the Dispatcher class, and multiple queues per dispatcher allow for a fair scheduling policy.



© 2012 Microsoft Corporation. All Rights Reserved.