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

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
Slet denne besked
Besvar denne besked
Skribent: User discussions
Dato:  
Til: User discussions
Emne: 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