[ros-users] Nodelets and thread safety

Daniel Stonier d.stonier at gmail.com
Sun Oct 24 01:32:05 UTC 2010


On 24 October 2010 08:15, Josh Faust <jfaust at willowgarage.com> wrote:

> A couple of the guys here at work were talking about passing around large
>> objects with the nodelets when we realised there was no thread safety
>> attached to the objects that were getting passed around. Is there any plans
>> to add this functionality to them? i.e. either via something like a
>> Mutex.msg you could include with your other msg's (aka Time.msg) or perhaps
>> via a thread safe shared pointer that you could use when publishing.
>>
>
> I'm not really sure what you mean -- boost::shared_ptr is atomically
> reference counted, so it the object won't be deleted out from under you if
> you have multiple subscribers to the same topic.  If you need to modify the
> object in the subscriber you can subscribe to a non-const version of the
> message, and it will make a copy for you if there are multiple subscribers.
>  Do you mean you want to be able to modify the object on the publisher side
> after you've sent it?
>
> Josh
>

Yes, exactly. i.e. sharing a large object between publisher and
subscriber(s) and you want to avoid any copying or recreation of the object.
The publisher is continually updating the large object and the subscribers
don't want to get caught by an update in the middle of reading. Is there
perhaps a better approach to this? How do the guys in the image pipeline
handle the sending of big objects - they simply recreate a new object every
time they want to send one?


>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>


-- 
Phone : +82-10-5400-3296 (010-5400-3296)
Home: http://snorriheim.dnsdojo.com/
Yujin Robot: http://www.yujinrobot.com/
Embedded Ros : http://www.ros.org/wiki/eros
Embedded Control Libraries: http://snorriheim.dnsdojo.com/redmine/wiki/ecl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20101024/26e2a9c0/attachment-0003.html>


More information about the ros-users mailing list