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

book: add sections about threading #152

Closed
wants to merge 5 commits into from

Conversation

elenaf9
Copy link
Collaborator

@elenaf9 elenaf9 commented Mar 6, 2024

Extracted from #133.

Add sections about multi-threading / riot-rs-threads to user and developer guide in the book.

Couple of open questions (marked as TODOs) within the text.

Happy to add additional sections/ details if you think anything is missing, or to remove stuff that might be too deep or still subject to change.

@elenaf9 elenaf9 requested a review from kaspar030 March 11, 2024 09:38
@emmanuelsearch emmanuelsearch added the docs Improvements or additions to documentation label Mar 11, 2024
@elenaf9
Copy link
Collaborator Author

elenaf9 commented Mar 15, 2024

Friendly ping @kaspar030, mind giving a review here? :)
Everyone else is also welcome to leave comments/ suggestions.

book/src/SUMMARY.md Outdated Show resolved Hide resolved

### Example

```rs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As asked elsewhere: this would be useful as an example. maybe just copy examples/threading to examples/threading_channel, put his code there, then use here via mdbook include (with anchor)?

(We can postpone that to a follow up)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in #223.

book/src/SUMMARY.md Outdated Show resolved Hide resolved
@@ -5,7 +5,112 @@

# User Guide

## Multi-threading

Riot-rs implements a scheduler based on fixed priorities and preemption.
Copy link
Collaborator

@kaspar030 kaspar030 Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a line here describing the scheduling policy (highest runnable thread always running).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 402434e.

@ROMemories
Copy link
Collaborator

It looks to me that most of this could become rustdoc of the riot-rs-threads crate. Keeping the docs closer to the impl would make them more likely to get updated when the implementation changes, and allow to link to items, again preventing the docs from lagging behind in case items are removed/renamed (broken internal links are already tested in CI).
If the concern is for some of the doc to not become SemVer'd implementation guarantees, I think they could be moved to a docs submodule in riot-rs-threads, explicitly excluded from SemVer guarantees in the text, and only rendered in the dev version of the rustdoc using the (upcoming) _devdoc feature (by feature-gating the docs module).

@elenaf9
Copy link
Collaborator Author

elenaf9 commented Apr 15, 2024

It looks to me that most of this could become rustdoc of the riot-rs-threads crate. Keeping the docs closer to the impl would make them more likely to get updated when the implementation changes, and allow to link to items, again preventing the docs from lagging behind in case items are removed/renamed (broken internal links are already tested in CI).

I agree. Most of these docs are extracted from the rustdocs anyway, but they could be moved into library/ module level docs in riot-rs-threads. However, if I understood @emmanuelsearch and @kaspar030 correctly, their idea was to additionally have these separate user- and developer guides in the book.

@elenaf9
Copy link
Collaborator Author

elenaf9 commented Sep 28, 2024

Closing this PR.
We agreed in an out-of-band discussion that these kind of docs should be rustdocs inside the crate, instead of book sections.
I've extracted the user-guide docs in #449.
The developer-guide docs were in fact simply a summary of our existing docs/ code-comments, so nothing new really.

@elenaf9 elenaf9 closed this Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation threading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants