-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update taking API documentation. #271
Conversation
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
rmw/include/rmw/rmw.h
Outdated
* finalization. | ||
* Therefore, it is safe to take from the same subscription concurrently. | ||
* However, when taking regular ROS messages: | ||
* - Access to ROS messages is not synchronized. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
* - Access to ROS messages is not synchronized. | |
* - Access to the same ROS message is not synchronized. |
I find that less confusing, but maybe it's just that I'm reading it incorrectly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I meant it in that sense. To say things
and to say the same thing
sounds equivalent to me, but I may be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well things
implies a group, whereas the same thing
implies a specific instance.
I'd say the suggested change is worth doing. Or you could say:
* - Access to ROS messages is not synchronized. | |
* - Access to the ROS message is not synchronized. |
Because in this case there's only one message interacting with this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment is still valid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! See 005ba40.
rmw/include/rmw/rmw.h
Outdated
* finalization. | ||
* Therefore, it is safe to take from the same subscription concurrently. | ||
* However, when taking regular ROS messages: | ||
* - Access to ROS messages is not synchronized. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well things
implies a group, whereas the same thing
implies a specific instance.
I'd say the suggested change is worth doing. Or you could say:
* - Access to ROS messages is not synchronized. | |
* - Access to the ROS message is not synchronized. |
Because in this case there's only one message interacting with this function.
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Oof, this is getting big. On top of what we discussed, I added a few more clarifications as to what to expect when a logical/runtime error occurs. |
Another thing we should also document is if |
I think |
I agree with it being synchronous, but non-blocking is a tricky one. Well, it depends on how you define it. I'd say we allow implementations to wait on locks, but we don't allow them to wait for external events (like a message arriving, or an empty message loaning pool getting refilled, effectively banning semaphores). Some implementation may choose to go full non-blocking, but that's a bit too much for all, I think. |
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
I think that non-blocking isn't the same as lock-free, but maybe I'm wrong. (edit) Mutex locking is considered a blocking operation, so I think you're right. It would be great to have a clear requirement in the doc block. |
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
See be1db39. Couldn't come up with a better subtitle than " Runtime behavior". I'm open to better naming. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, great work @hidmic!!!
Maybe in the future, we can only have a single Thread-safety
, Memory-Allocation
, Runtime-Behavior
paragraph for the whole "take data" API, and link to that single paragraph from the documentation of each function.
I'm not quite sure on how to do that in doxygen.
rmw/include/rmw/rmw.h
Outdated
* finalization. | ||
* Therefore, it is safe to take from the same subscription concurrently. | ||
* However, when taking regular ROS messages: | ||
* - Access to ROS messages is not synchronized. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment is still valid
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Alright, going in! |
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
Precisely what the title says. Closely related to #270.