kernel: timeslicing: add time slice reset in slice per thread api - #71855
fabiobaltieri merged 1 commit into
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>
andyross
left a comment
There was a problem hiding this comment.
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