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

thread_yield, thread_switch, etc. should reset the quantum? #27

Open
ghost opened this issue Oct 23, 2017 · 1 comment
Open

thread_yield, thread_switch, etc. should reset the quantum? #27

ghost opened this issue Oct 23, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 23, 2017

I think we may need this but the project doc doesn't say explicitly.

The way we have it written currently, when thread_yield or anything that performs a context switch chooses a new thread, it doesn't give the new thread a fresh quantum, but instead keeps running on the old, partially expired quantum.

We might need to call setitimer() in every context switch

@elliott-beach
Copy link
Owner

If a running thread is suspended (discussed later) or yields
voluntarily, its remaining time slice will be abandoned

So the quantum should be reset by uthread_yield.

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