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

Expose sleep-wait functions. #148

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Expose sleep-wait functions. #148

merged 1 commit into from
Dec 14, 2023

Conversation

davidchisnall
Copy link
Collaborator

We didn't have generic functions for spinning / sleeping and they're quite important.

@nwf-msr
Copy link
Contributor

nwf-msr commented Dec 13, 2023

These are fine, I guess, even if I generally think large waits should be CPS hung off timers and short waits shouldn't be a thing. Where did you find you needed them?

@davidchisnall
Copy link
Collaborator Author

These are fine, I guess, even if I generally think large waits should be CPS hung off timers and short waits shouldn't be a thing. Where did you find you needed them?

Short sleeps are normally needed (in interrupts-disabled things) for bit banging. The longer one is needed when initialising the Ethernet PHY (requires a 167ms sleep, which can be a wait for a few ticks and then spin for any remaining time).

We didn't have generic functions for spinning / sleeping and they're
quite important.
@davidchisnall
Copy link
Collaborator Author

I generally think large waits should be CPS hung off timers

This is also necessary for implementing a timing wheel for CPS callbacks. We may want to separate out the sleep-delay calculation so that it can be integrated with a timeout for event-driven code.

@davidchisnall davidchisnall merged commit e8f558a into main Dec 14, 2023
7 checks passed
@davidchisnall davidchisnall deleted the sleep branch December 14, 2023 10:35
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

Successfully merging this pull request may close these issues.

2 participants