-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
kernel: timeslicing: add time slice reset in slice per thread api #71855
kernel: timeslicing: add time slice reset in slice per thread api #71855
Conversation
This will reset time slice in k_thread_time_slice_set() when slice per thread api is used. Currently it will reset it only in standard slice_set Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. The original intent of the API was that timeslice parameters would be set only on non-running threads. Not opposed in principle to making this work everywhere, but it's worth pointing out that this is extra code to handle what the framework almost certainly is doing already? What's the use case? Just setting your own timeslice?
Might be worth adding a note to the API docs to explain that the results are applied synchronously and that this will result in the reset of an already-partially-executed timeslice (i.e. that the thread is likely to get "more" time because of this call than it would have expected).
@andyross use case is described here (Task with Budget part): so basically we want to set and reset timeslice with each LL tick |
This will reset time slice in k_thread_time_slice_set() when slice per thread api is used.
Currently it will reset it only in standard k_thread_time_slice_set