Multiple Threads in Single ROS Node
What is the preferred threading library to use when trying to write a ROS node with multiple threads? Boost::Thread ? Posix ? Pthreads ?
Are there any issues with callback functions when multiple threads are used?
The reason I want to use multiple threads in a single node instead of writing multiple nodes is that I am trying to integrated ROS with another publish and subscribe system called MOOS, which is used heavily in the underwater robotics community. (Found here: http://oceanai.mit.edu/moos-ivp/pmwiki/pmwiki.php). Unfortunately, the MOOS architecture relies upon the user calling a blocking function that sits and spins in a loop (similar to ROS, but all the initial logic is tied up in that one function as well). I want to run that blocking function in its own separate loop, grabbing data from the MOOS system and then publishing it to the ROS side.
Any tips?