Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An implementation of
Scheduler
which uses workers executing in a separate thread to run actions.Still requires more testing.
When considering the roboRIO as a platform (which contains an dual-core ARM Cortext-A9), this may not provide much since it only has 2 cores and it is quite likely that there are enough threads (and other processes) executing on the system.
A lot of the implementation depends on cache coherency being maintained across multiple cores. This can be traced to 2 reasons:
ActionContext
orActionState
)According to developer.arm.com
Concept
The idea is pretty straight forward. The scheduler manages several workers, each running in a separate thread, which is a simple daemon.
At any given moment, a worker handles one action, grabbing it from a shared work queue. That action is handled by executing a single cycle (
ActionContext.run
). If the action is finished, it is inserted into a shared finished queue. Otherwise, it is inserted into the shared work queue to be handled again.In order to properly synchronize requirements usage, actually starting and finishing actions is done in the main thread of the robot (which is used to run
Scheduler.run
).Scheduler.run
is used to