-
Notifications
You must be signed in to change notification settings - Fork 3
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
Schedule threads by priority order #2
Comments
hangpark
added a commit
that referenced
this issue
Mar 25, 2017
When a thread is changed to `THREAD_READY`, i.e., when `thread_yield()` or `thread_unblock()` is occured, it is put into the ready list. To deal with priority scheduling, the ready list is now ordered by priority.
hangpark
added a commit
that referenced
this issue
Mar 25, 2017
When priority of a thread is changed or when a thread is created, preemption would occur. In this case, we need to switch thread with highest priority by yielding the current. Note that `thread_unnblock()` does not preempt the running thread, thus nothing to be done additionally in it.
hangpark
added a commit
that referenced
this issue
Mar 25, 2017
Semaphore wakes a thread with highest priority up among its waiting list now. Note that `thread_compare_priority()` is changed to global.
hangpark
added a commit
that referenced
this issue
Mar 25, 2017
Priority donation part is of #3 . |
Re-open issue to implement priority scheduling in lock. |
This priority scheduling for lock is already and automatically implemented in for semaphore. So just close the issue. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make higher priority thread wake up earlier by modifying the scheduling algorithm.
The text was updated successfully, but these errors were encountered: