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

sl_thd_param_set() API behavior after initialization #407

Open
phanikishoreg opened this issue Aug 28, 2020 · 0 comments
Open

sl_thd_param_set() API behavior after initialization #407

phanikishoreg opened this issue Aug 28, 2020 · 0 comments

Comments

@phanikishoreg
Copy link
Member

phanikishoreg commented Aug 28, 2020

In the current code base, sl_thd_param_set() doesn't take the CS to update parameters.
We can fix that to just do (see here: b173b2a#diff-96720fe9dba7901d69a833a3c3bee4ab) :

sl_cs_enter()
// set the parameter
sl_cs_exit()

This is not sufficient especially if the parameters are updated dynamically after thread initialization and it first starts running.
For example, updating the priority of a thread after it starts running will not impact on the scheduling in the system until a next timer tick and the current thread continues its execution with the current priorities.

This just means, after thread initialization, if parameters are changed, instead of sl_cs_exit() we'd need to call sl_cs_exit_schedule() so the policy and thread param changes take effect immediately.

One proposal: I think it might be difficult to decide the phases of thread (initialization --> running --> etc, especially if we have multiple parameters to initialize or update).. So I think it would be good to have 2 separate API, one for initialization of thread parameters that doesn't call reschedule, something like sl_thd_param_init, likely mainly used by schedulers on thread creation, and the other sl_thd_param_set that is used after initialization, that always calls reschedule upon updating a thread parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant