Priority-Based Scheduler for xv6 #405
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Priority-Based Scheduler for xv6
Summary
This PR adds a priority-based scheduling algorithm to xv6, along with syscalls to manage and inspect process priorities. It also implements aging and de-aging to prevent starvation.
Changes
Process Structure
priority
,sticks
, andwticks
for scheduling.New Syscalls
getppid()
- returns parent PIDgetprio()
- returns running process prioritysetprio()
- sets current process prioritysetprioforproc()
- sets priority for a specific PIDyield()
- allows user-space process to yield CPUcprintf_locked()
- synchronized printf for consolePriority Scheduler
init()
have fixed priorityMotivation
This PR demonstrates advanced scheduling concepts such as priority scheduling and aging in an educational OS environment. It can be used for learning or experimentation.
Notes