Repository navigation
Add rmw_waitset_t and create/destroy functions - #49
Conversation
There was a problem hiding this comment.
What does fini do that destroy doesn't? Maybe put another way, what is the expected usage of fini without a matching init function?
There was a problem hiding this comment.
I guess this doesn't need to be its own function right now, since all it does is detach all currently attached conditions, which we expect to happen in the WaitSet destructor.
There was a problem hiding this comment.
After reading what it's implementation does in your rmw_opensplice pr, I'd say it is the counter part to rmw_wait, such that it would be used like this:
rmw_create_waitset- while running:
rmw_waitrmw_fini_waitset
rmw_destroy_waitset
But then the question becomes, why not detach at the end of every call to rmw_wait?
If we leave the separate function in, maybe we should consider renaming it to something like rmw_waitset_reset or rmw_waitset_clear or rmw_waitset_detachall, etc...
There was a problem hiding this comment.
I think avoiding the extra function and detaching all conditions within rmw_wait makes sense. rmw_wait could also ensure the precondition at the beginning that no conditions are attached.
There was a problem hiding this comment.
I've removed rmw_fini_waitset and moved the code into the scope exit destructor.
It requires more effort, but I still think I should refactor this function to use a goto fail to propagate any errors that occur while detaching conditions.
There was a problem hiding this comment.
fixed_guard_conditions is not documented and I am not sure how it is supposed to be used.
1d464b8 to
762f7cf
Compare
|
@jacquelinekay Do you want to get this set of changes into alpha3? |
|
That would be really fantastic. It reduces allocations in both rmw implementations. Actually, it makes There is a pending set of changes that I haven't pull requested yet because I had a clean set of Jenkins job for this set of branches but I neglected On Thu, Dec 17, 2015 at 4:07 PM, gerkey [email protected] wrote:
|
|
I had to rebuild the CI jobs because the examples in realtime_support that pass arguments to the Executor needed to be refactored. |
|
+1 |
|
LGTM |
|
can you guys clarify if those +1s are for just the rmw PR or the whole thing? |
|
I only looked at this one - reading the other ones now. |
762f7cf to
08bcbf1
Compare
|
I realized as I was rebasing my branches today to get this the build with the rcl refactor that @wjwwood may have miscommunicated about what I call a "waitset" in rmw and what he implemented in rcl as a I'm currently thinking about how to incorporate the features that I implemented in my set of branches with rcl so that it's full featured, but it would require a few API changes to rcl and I'm not sure if we have tiem for that right now. So, I'll probably throw in a dummy_waitset of type rmw_waitset_t into rcl so that the API matches my change to rmw_wait and incorporate the full functionality next week. |
|
I also realized that I have to make a pull request to rmw_fastrtps_cpp now that it's merged, which may take some work because they use a std::condition_variable instead of something like a dds WaitSet. |
|
OK, then let's leave this PR out of alpha3. |
|
alright. This was poor timing/planning by the team. I should have made more of an effort to get this PR reviewed and merged well before the fastrtps repository was merged. I considered it ready for review nearly a week before it received review. Or, rmw_fastrtps should have had an earlier deadline so that we could have had more time to adapt it to the changes we wanted to make the rmw API. |
|
I agree I think we should have serialized the merge of changes to rmw and inclusion of fastrtps differently. I should have noticed other pull requests, like this one, which had been in review before mine and pointed out the oncoming conflict. |
|
Agreed, we didn't consider the full consequences of adding FastRTPS. |
574488f to
336c4fb
Compare
|
The rmw_fastrtps changes are in this pull request (I don't think we have FastRTPS added to Waffle): The new (and hopefully final?) set of CI jobs are here: http://ci.ros2.org/job/ci_linux/821/ |
|
not sure why Jenkins fails; the same tests pass on my machine (except for tests that are also failing on the nightly build, such as test_services_cpp__rmw_fastrtps_cpp) |
There was a problem hiding this comment.
Is it correct that the fixed_guard_conditions are only detached but not destroyed when the waitset is destructed? Should that be mentioned explicitly in the docstring?
There was a problem hiding this comment.
fixed_guard_conditions is expected to be allocated and fully initialized when provided to this function. I think it's better for the caller of this function to be responsible for destroying the object, instead of the function itself, since this function does not allocate the memory.
There was a problem hiding this comment.
I fully agree to that. I only think something like the following would clarify the documentation:
fixed_guard_conditions must stay valid until rmw_destroy_waitset hsa been called and the caller keep the ownership of the allocated guard conditions.
65768e4 to
9afe2a5
Compare
Add rmw_waitset_t and create/destroy functions
Improvements discussed in ros2/rmw_opensplice#96 and offline.
Seeking feedback on this approach before implementing it for Connext.
This API change will allow for several improvements to be made.
trigger_guard_condition.