-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit incorporates several changes: Timers are now not set for a regular tick, they are set when a thread may be preempted. Specifically, the timer is set to the next timeout that will trigger a scheduling operation. This avoids timers triggering a switch to the scheduler to do nothing (resume the currently running thread). This means that if a thread sleeps for ten ticks while another runs, we will get one timer interrupt ten ticks in the future, rather than ten interrupts one tick apart. This means that ticks are now calculated retroactively based on elapsed time, rather than counted on each context switch. This, in turn, necessitates some small API changes. We previously conflated two things: - Sleep for N * (tick duration) - Yield and allow lower-priority threads to run for, at most, N * (tick duration) These are now deconflated by adding a second parameter to thread_sleep. Most sleeps are of the first form and so this is the default.
- Loading branch information
1 parent
64d8c26
commit 48b9d4f
Showing
11 changed files
with
221 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.