-
Notifications
You must be signed in to change notification settings - Fork 419
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
Ensure waitables handle guard condition retriggering #2420
Ensure waitables handle guard condition retriggering #2420
Conversation
lgtm, execpt for the dummy stuff ;-) |
@wjwwood I went through and cleaned out the |
@wjwwood Looking at you const changes to the execute API, it occurred to me, that it might be way better to use a std::unique_ptr here. I got two motivations for this proposal:
|
I especially agree on the clearer semantics in this case. |
I will look into the feasibility of using Also for semantics, const-ref to shared_ptr implies copy is possible but not guaranteed (see: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-sharedptrparam-const), so the semantics are clear enough to me at least, but maybe unique_ptr is actually sufficient (which would imply taking ownership as you all said: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-uniqueptrparam) |
What was there before, non-const-ref to shared_ptr, is definitely not what we want to convey in the APIs semantics, i.e. that it might reset/reseat the given pointer (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-sharedptrparam). |
The data pointer needs to be copied at least one time into the AnyExecutable. |
@mjcarroll to run CI on this. |
I think that this is actually ready for review. I'm going to run CI to at least see where we are at on it. |
bf03d2f
to
c15d924
Compare
I retargeted this onto #2142 temporarily until it is merged, then I'll retarget it to |
…gging code still there Signed-off-by: William Woodall <william@osrfoundation.org>
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
Signed-off-by: William Woodall <william@osrfoundation.org>
c15d924
to
3fa7416
Compare
I'd like to merge #2467 before pushing this one for review. |
Now that #2467 is merged, I need to fix this pr up, which I will do asap. |
@wjwwood I rebase this on head an cleaned it up a bit : Note, I removed the SubscriptionIntraProcess::add_to_wait_set as its already handled in the base class. |
Thanks, Edit: I see you put it on a different branch, thanks. I'll compare what I had been working on. |
3fa7416
to
569921e
Compare
Trying to close and reopen the pr to fix the processing of new commits... |
It won't let me reopen it because the current target branch has been deleted, and I cannot edit it to change the target branch while closed, so I made a new pr: #2483 |
An emerging responsibility of Waitables that wasn't explicitly declared before is that they should be ensuring guard conditions should stay ready between waits so long as the condition for them being triggered is still true.
Some waitables will not need this, e.g. waitables that are used to only wake up an executor once, but don't have events tied to them don't need to be retriggered. But other waitables which use guard conditions to notify the executor of work to be done need to keep triggering those guard conditions on subsequent waits, so long as the work associated with them has not been completed.
This is still a WIP. I'll add more cross references and details here in the future.