Re: [ros-users] Nodelet multi-threading example

Top Pagina
Bijlagen:
Bericht als e-mail
+ (text/plain)
Delete this message
Reply to this message
Auteur: User discussions
Datum:  
Aan: User discussions
Onderwerp: Re: [ros-users] Nodelet multi-threading example
This would make a good answers.ros.org question:

On Sun, Dec 18, 2011 at 6:37 AM, K Chen <> wrote:
>
> I am finding a way to separate some heavy load process into some standalone
> threads so that I could get other callbacks in time using nodelet. I looked
> at the nodelet wiki page but it has few description about its
> multi-threading model and usage, so I am wondering where I could find such
> usage examples or projects already doing this?


Multiple nodelets can run in parallel on different threads within the
same address space. There is a shared pool of nodelet threads.
Callbacks for a single nodelet may be limited to a single thread, or
may be multithreaded.

http://www.ros.org/wiki/nodelet#Threading_Model

> BTW, is creating my own threads using boost inside a nodelet a bad idea?


That works fine. Create a boost::shared_ptr to a boost::thread in your
onInit() method.
--
 joq