-
Notifications
You must be signed in to change notification settings - Fork 401
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
Deprecate posix timer #337
Comments
@marthtz I think a stopwatch is not exactly what we need. We have to rewrite the timer so that the timer does not work with callbacks anymore but instead with signals. If you look at the manpage https://man7.org/linux/man-pages/man2/timer_create.2.html we have to possible approaches:
I think we should explore the second option. Maybe it has similar drawbacks than the callback approach but if not it should be our way to go. @elBoberido what do you think? |
@elfenpiff @marthtz please don't call it stopwatch. A stopwatch is measuring time, this functionality is running towards a deadline or countdown. See also the equivalent int boost and Qt. To the other points. The posix timer was started as a deadline timer and then enhanced with the posix calls. Currently it has both functionalities.
|
@elfenpiff I am currently working on this story. Based on the comments from @dkroenke I am working on to replace the timer.start() function with a simple thread sleep. Currently the posixtimer.start() is being called within the posh_runtime, service_discovery_notifier. |
@shankar-bosch a simple |
@elBoberido okay I will do so |
@shankar-bosch if you are working on an issue could you please assign it to you and add it into the iceoryx 1.0 board: https://github.com/eclipse/iceoryx/projects/2 so that everyone is aware of it. |
@elfenpiff sure. I am not in the list of contributors. Could you pls add me? I can assign this issue in my name and bring this to the board. |
@elBoberido I have clarifications. As you know the timers can be one shot or periodic based on the it_interval . I also dont see the |
@elfenpiff This can only be done by an Eclipse committer. Eclipse committers are voted on in elections. |
@mossmaurice Thank you |
@elBoberido |
@ithier that's the idea of this issue. There is an additional functionality in the timer (checking for a deadline) and that should to be preserved |
@shankar-bosch the thread is started implicitly. Have a look at https://linux.die.net/man/2/timer_create, we use SIGEV_THREAD If you use just |
Here is where the timer is used in iceoryx:
From above, it looks like we only need to do add the heartbeat thread above and write some kind of helper method to wrap the usage of |
it just occurred to me that sleep_for might be really bad for the test time, since it's not interruptible. How about creating a small wrapper around a semaphore with timed wait?
Later on the semaphore could be replaced by POSIX |
Current PR #333 also makes use of the timer. Basically, it's checking for a timeout / interval expiry. @elBoberido wrapper sounds good to me and could be used for this and @ithier first bullet point. |
@elBoberido Thanks for the wrapper solution. |
We should definitely fix this for 1.0, On ARM 64 I have failing tests because of #190 but I fear that's not the only problem |
@elBoberido That's at least half of the game. The failing |
@budrus it could still be a rounding issue. AFAIK, the timer doesn't sleep for e.g. 100ms but for |
@elBoberido @budrus I suggest here to use neither of them. I would create a struct which looks like struct duration_t {
uint64_t seconds;
uint32_t nanoseconds;
}; The reason is that a duration cannot be negative, you cannot wait -5 seconds but And when we refactor |
I will take the solution for the truncation issue as suggested by @elfenpiff. Thank you. @budrus Is there a seperate ticket for failing DestructorIsBlocking issue? |
…xed part of iox-eclipse-iceoryx#243 Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
…structor within timer Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
…w line Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
…oryx#337-deprecate-posix-timer Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
…uality Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
…eoryx#337-deprecate-posix-timer Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
…improvements Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
…yx#337-deprecate-posix-timer Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
…ix typo Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
… and handle expected errors Signed-off-by: Sankara Narayanan Chandrasekar (RBEI/EMT2) <[email protected]>
Use std::chrono::steady_clock instead of PosixTimer Signed-off-by: Marika Lehmann <[email protected]>
Use std::chrono::steady_clock instead of PosixTimer Signed-off-by: Marika Lehmann <[email protected]>
Signed-off-by: Marika Lehmann <[email protected]>
@elBoberido could you pls reassign this issue to my personal account? |
Done |
thanks @dkroenke |
iox-#337 remove posix timer
Brief feature description
Deprecate posix timer from iceoryx code base.
Detailed information
Posix timer has several issues (concurrency, truncation) and is pretty heavy weight and a bit slow. As iceorxy needs to be very responsive the posix timer should be removed and replaced with a lightweight stopwatch.
This will also close #190 as it'll be obsolete.
Tasks
DeadlineTimer
or similar and replace this part of thePosixTimer
where applicableposix::semaphore
which can be used forconcurrent::PeriodicTask
std::chrono
timestamp with aunits::Duration
from atimespec
initialized withclock_gettime
withCLOCK_REALTIME
-> maybe better to use a different issue for thisThe text was updated successfully, but these errors were encountered: