posted on Thursday, March 11, 2010 - 11:04 am
Hi, I want to develop a chat application using DDS. I am using Linux for development. I have created the publisher and the subscriber as a single executable, but the publisher and the subscriber run in two different threads. The idea here is to have the publisher and subscriber run in sync with each other at the same time, so that when I fire up the application, I am able to send and receive messages on the same terminal. But the problem here is that the application is throwing lot of errors. I wanted to know if such a construct was permitted in DDS. Please help
A good DDS implementation has a fully reentrant API, so you should be able to have 2 separate threads using and even sharing DDS entities at the same time.
I think most DDS implementations are implemented in a multithread safe manner, but I can say for sure that OpenSplice DDS is. If you still have errors, probably they are related to to other causes. (You can try by running the code for both threads sequentially in 1 thread.)