Skip to content
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

Clearly document semantics of ltimer set_timeout functionality #54

Open
bennoleslie opened this issue Sep 27, 2020 · 0 comments
Open

Clearly document semantics of ltimer set_timeout functionality #54

bennoleslie opened this issue Sep 27, 2020 · 0 comments

Comments

@bennoleslie
Copy link

The parameters for the set_timeout function are documented in platsupport/ltimer.h however the semantics are not very clear.

Specifically, what is the correct behaviour if called with a time that is in the past (and/or called with a time that is in the past by the time the callee completes, consider the function could be interrupted by a higher priority thread at any point in time).

In addition, the semantics associated with IRQs may come in earlier than requested due to implementation details seems difficult for a caller to use correctly. It seems like the caller would then need to call get_time or something to check. In my experience most timeout APIs guarantee to wait for at least the specified time, but don't make guarantees about how soon after the requested expiry the actual callback is made. I suggest that this might be more useful set of semantics to consider specifying instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant