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

Schedule threads by priority order #2

Closed
hangpark opened this issue Mar 25, 2017 · 3 comments
Closed

Schedule threads by priority order #2

hangpark opened this issue Mar 25, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@hangpark
Copy link
Owner

Make higher priority thread wake up earlier by modifying the scheduling algorithm.

@hangpark hangpark added this to the Project #1 milestone Mar 25, 2017
@hangpark hangpark self-assigned this Mar 25, 2017
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
Copy link
Owner Author

Priority donation part is of #3 .

@hangpark
Copy link
Owner Author

Re-open issue to implement priority scheduling in lock.

@hangpark hangpark reopened this Mar 25, 2017
@hangpark
Copy link
Owner Author

This priority scheduling for lock is already and automatically implemented in for semaphore. So just close the issue.

@hangpark hangpark mentioned this issue Apr 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant