Coordination Primitives

5 posts / 0 new
Last post
dknippel's picture
Offline
Last seen: 4 years 2 months ago
Joined: 09/09/2014
Posts: 10
Coordination Primitives

Hello,

Does DDS provide any built-in coordination primitives to address asynchronous behavior.  For example, some typical primitives would be Receive<T>, Choice<T>, MultipleItemReceive<T>, and Interleaves for Teardowns/Exclusive/Concurrent message pumps.  Most examples I've seen utilize various Mutexes, Semaphores, Montior, Lock, etc.  In hopes of not reinventing the wheel, I was wondering if RTI has developed any supported coordination primitives.

Thank you,

Dennis

Organization:
dknippel's picture
Offline
Last seen: 4 years 2 months ago
Joined: 09/09/2014
Posts: 10

Would a possible option be the integration of DDS with Rx, as summarized here: 

http://blogs.rti.com/2014/04/09/reactive-programming-using-rx4dds/

sumant's picture
Offline
Last seen: 6 years 9 months ago
Joined: 02/02/2011
Posts: 7

In general, DDS offers powerful data distribution (write, qos, transport, receive) capabilities but limited "processing" capabilities. A DDS DataReader offers various ways to receive data such as, listeners for push-based notification, read vs take for polling, access one or more elements at a time (i.e., max_samples) (similar to MultipleItemReceive), waitsets and read-conditions to receive data from several DataReaders at a time (similar to MultiplePortReceive), and query-conditions enable application-specific filtering and demultiplexing while receiving data (appears similar to Receive<T> with predicates). DDS (standard) includes a way to join data from two or more data sources using what's called MultiTopic which appear quite similar to JoinedRecive in CCR. These capabilities are not "coordination primitives" instead I like to think of them as data reception primitives.

These primitives can be elevanted to the higher "processing" level as we start associating application-level code segments to them. For example, the new DDS C++ and Java PSM allow association of functionality (lambdas and/or function objects) directly to read and query conditions. The overall trend is therefore towards supporting higher processing elements.

Integrating DDS with frameworks that are designed for coordination of asynchronous behavior is quite natural. Reactive Extensions (Rx) is one such cross-platform framework. Microsoft Robotics Coordination and Concurrency Runtime (CCR) may be another one. Vert.X is yet another alternative. The requirements of app-level coordination will determine the framework. For instance, if you are looking for an exhaustive library of coordination primitives (~ 100) that is truly cross platform and functional style of programming is acceptable Rx is a great option. RTI has DDS+Rx integration available at https://github.com/rticommunity/rticonnextdds-reactive.

The examples mentioned above appear to be from MS CCR, which on the first look appears imperative. Nothing wrong about imperative but in my experience, I've found functional abstrations map nicely to asynchronous processing of streams that DDS brings to your doorstep. Rx enables the same dataflow model for both data processing and distribution. Further, you can introduce concurrency easily using scheudlers as long as data processing pipelines take immutability seriously. No explicit mutexes, semaphores, locks are necessary in that case. We explain that and several other ideas in detail in this research papper with Vanderbilt University: http://community.rti.com/paper/scalable-reactive-stream-processing-using-dds-and-rx

dknippel's picture
Offline
Last seen: 4 years 2 months ago
Joined: 09/09/2014
Posts: 10

Sumant,


Thank you for the time you've taken to respond.


I'm impressed by your familiarty with Microsoft's CCR.  I'm literally right here in mickeysoft's backyard (Bellevue, Washington) and would say with only slight exageration that 95% of their employees are not even aware that MS had a robotics platform (Microsoft Robotics Developer Studio).  Regardless, RTI's Connext looks freakishly similar to CCR/DSS.

Both Microsoft's and RTI's technologies are formidable.  However, I would venture to say that RTI's support for their DDS implmentation far exceeds that of Microsoft's.  Thank you for your suggestion of using Rx with RTI's Connext platform.  Admittedly, I'm more familiar with Task Parallel Library but I'm sure the leap is not too drastic.

 Again, thank you for your feedback.  I look forward to further correspondence.

Best regards,

Dennis

dknippel's picture
Offline
Last seen: 4 years 2 months ago
Joined: 09/09/2014
Posts: 10

Hi Again, Sumant.

I've reviewed both your suggested Vanderbuilt paper, as well as some external publications on Rx.  It had been a while since I looked at Rx, but as soon as I did I was reminded of how RTI Connext and MS Robotics Developer Studio (MRDS) are freakishly similar.  Basically, RTI Connext is a rough equivalent to MRDS's CCR, while Microsoft morphed DSS into Rx.  So basically using RTI Connext in conjunction with Rx is roughly the same as using MRDS's CCR & DSS.  Again, both RTI's and Microsoft's technologies are formidable.  Fortunately for RTI though, Microsoft mothballed their Robotics Group (http://www.neowin.net/news/microsoft-layoffs-claims-robotics-research-team-over-the-weekend).  Aaaah, so sad.

Regards,

Dennis