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

Start of Zephyr work-q support #45

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Start of Zephyr work-q support #45

wants to merge 9 commits into from

Conversation

d3zd3z
Copy link
Collaborator

@d3zd3z d3zd3z commented Dec 20, 2024

This is some basic playing with Zephyr work queues, eventually with a goal of supporting both direct use of work queues as well as Futures.

This basic version is able to run a simple async Future that can use a 'sleep' function.

An earlier change updated all of the crate version numbers to match a
Zephyr release.  This is problematic for several reasons:

- Zephyr releases don't correlate with semantic versions.  In general,
  it is probably best to assume every Zephyr release is a semantic
  change, and should have a major version bump.
- Cargo does make some assumptions about the meaning of semantic
  versions (for example, that it can use a version that would be
  considered semantically equivalent.
- The Rust support consists of multiple crates, and there is no
  particular reason to tie the version numbers of those together.

At this point, the Rust support for Zephyr is experimental, and
definitely needs a 0.x.y version number.  Revert everything back to
0.1.0.  As this stabilizes more, we can start to come up with
appropriate numbers.

Although we are quite a w ways from it making sense to include any of
this in the crate ecosystem, it will still be helpful to have meaningful
numbers if we ever do decide to do that.

Signed-off-by: David Brown <[email protected]>
The work module provides various interfaces for interacting with Zephyr
work queues.  This is a beginning of that support.

Signed-off-by: David Brown <[email protected]>
After rebasing on the Zephyr change that moves versions back to 0.1.0,
adjust those in the crate we are adding.

Signed-off-by: David Brown <[email protected]>
This shouldn't have been checked in.

Signed-off-by: David Brown <[email protected]>
Make a real Waker that is in an Ark.  There is still some unpleasant
casting to get this back to the type, and I haven't done any analysis to
see if data is being leaked, but this does not run correctly.

Signed-off-by: David Brown <[email protected]>
Adjust for the new futures version, where there is a builder that then
has a `start` that returns a `Work` that only holds on to the
allocation, and waits for an answer.

Signed-off-by: David Brown <[email protected]>
Change the name of the sample to be unique.

Signed-off-by: David Brown <[email protected]>
This will catch instances of the work itself being stopped before the
Future running in it has terminated.  Not ideal, as it should be
permissible to drop it.

Signed-off-by: David Brown <[email protected]>
The WorkWaker now really does implement Sync, as we use an Arc and Mutex
to protect it.

Signed-off-by: David Brown <[email protected]>
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.

1 participant