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

riot-rs-runqueue: support multiple currently running threads #244

Closed
elenaf9 opened this issue Apr 10, 2024 · 1 comment
Closed

riot-rs-runqueue: support multiple currently running threads #244

elenaf9 opened this issue Apr 10, 2024 · 1 comment

Comments

@elenaf9
Copy link
Collaborator

elenaf9 commented Apr 10, 2024

riot-rs-runqueue was designed under the assumption that there is only a single "head" of the runqueue (see get_next, advance, etc.).

In case of multicore, there may be more than one currently running thread.
The two (simplest) alternatives for supporting this are:

  1. Global Scheduling: Use a global runqueue for all threads and cores
  2. Partitioned Scheduling: Use a separate runqueue per core

After some research and looking into other embedded OSes, I would propose we go for 1), because:

  • For now, we only target platforms with small number of symmetric cores (e.g. the RP2040)
  • A global runqueue makes best use of the available capacity
  • Thread allocation in case of partitioned scheduling can become quite complex

The runqueue therefore needs to be refactored for global scheduling, so that get_next returns a different thread for each core.

@elenaf9 elenaf9 mentioned this issue Apr 10, 2024
12 tasks
@elenaf9 elenaf9 changed the title Adjust riot-rs-runqueue to support multiple currently running threads riot-rs-runqueue: support multiple currently running threads Apr 10, 2024
@elenaf9 elenaf9 linked a pull request Apr 10, 2024 that will close this issue
@elenaf9
Copy link
Collaborator Author

elenaf9 commented Sep 5, 2024

Closing because I decided to for an alternative implementation of the multicore scheduler, where the runqueue itself doesn't need to support multicore. Instead, the scheduler simply removes the current thread from the runqueue so that the head of the runqueue doesn't get picked twice.

@elenaf9 elenaf9 closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants