-
Notifications
You must be signed in to change notification settings - Fork 195
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
NetworkClock: unblock all waiting threads if a network reset is detected #2494
Conversation
This comment has been minimized.
This comment has been minimized.
Thanks @Giulero ! Can you add a file in https://github.com/robotology/yarp/tree/yarp-3.4/doc/release/yarp_3_4 to document this change? Thanks! |
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.
Some improvements suggestions.
@xEnVrE if you use the YARP_CLOCK for Gazebo simulations, I guess you could be interested also in this. |
Thanks @traversaro for the suggestions! |
00aea7b
to
40d98fe
Compare
I have a very small concern about this patch. If, for example, someone defines a clock, similar to what @PeterBowman did in #2488 (comment) which is based on a non-monotonic clock, and the clock adjusts of a few microseconds, this patch will notice that I'd rather keep the thread blocked, and update the wake up time in this way: @Giulero and @traversaro what do you think? |
I agree! I'll try the modification. |
@drdanz @traversaro I tried the modification but maybe I did something wrong. Correct me if I'm wrong. From what I understood, a delay (of 1) is requested ( Updating Even if it does not work, I commit the modification (f216964), since I probably just misunderstood the suggestion. |
Should't we simply modify |
I think the same! Even if it seems that the condition I also tried to modify |
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.
@Giulero Friendly ping 😜
I think this patch does not require much work in order to be merged, please do not forget about this.
|
||
#### `os` | ||
|
||
* If in a `yarp::os::NetworkClock` a clock reset is detected, unblock all the threads that are blocked waiting on a `yarp::os::NetworkClock::delay` call on that network clock. A network clock reset is defined a jump in the past of the time published by the network clock port. This avoid that if `YARP_CLOCK` is set, `yarp::os::PeriodicThread` silently stops to run if the network clock is reset. |
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.
The description here should also be updated...
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.
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 Now, thanks.
This comment has been minimized.
This comment has been minimized.
ab17f0f
to
062e693
Compare
… reset is detected Co-authored-by: Daniele E. Domenichelli <[email protected]>
062e693
to
e7e22b4
Compare
Merged, thanks. |
This PR implements the suggestions of @traversaro (see #800 (comment)) to handle the time reset.
This fix should avoid the phenomena of threads stopping and resuming after the time at which the clock was previously reset has passed.