ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

why "simple message" classes are not thread safe?

asked 2017-12-11 07:09:08 -0600

ManMan88 gravatar image

updated 2017-12-11 07:12:14 -0600

Why does all of the industrial simple message package classes has a warning: THIS CLASS IS NOT THREAD-SAFE? What makes them not thread safe?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-12-11 08:53:04 -0600

gvdhoorn gravatar image

updated 2017-12-11 08:53:46 -0600

What makes them not thread safe?

The message classes are (de)serialising C-structs from/to a byte buffer.

Buffer accesses are not thread safe, as they don't lock any of the resources that they use.

In addition to that reading and writing bytes from/to the network socket file descriptor is not guarded either.

edit flag offensive delete link more

Question Tools



Asked: 2017-12-11 07:09:08 -0600

Seen: 132 times

Last updated: Dec 11 '17