how are threads used to service callbacks in nodelets? [closed]
I have several nodelets, each subscribes to different messages (using the single threaded node handle). However, I realized one of my nodes, which subscribes to images and to odometry messages, and which takes long to process a single image (and therefore looses odometry messages in the mean time). Another nodelet, also subscribed to odometry messages, receives all of them while the first nodelet is busy with an image. So I understand the image callback of the first nodelet is being serviced by a different thread than of the second nodelet. However, inside a single nodelet, it appears that servicing one callback blocks the other callback.
I really don't understand how does the nodelet manager uses threads to service callbacks both between nodelets and inside the same nodelet.
- What would be the difference between using the single-threaded and multi-threaded node handles of the nodelet manager?
- Does the nodelet manager have a single queue which receives all messages that nodelets subscribes to, and then uses the worker threads to service these? Or does each nodelet have a separate callback queue?
- What I should I do if I only want to process two specific callbacks in parallel (after making them thread-safe) of a single nodelet, but still call any other callback (from this nodelet or others) serially?
No answers yet? I have the same doubts.