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

Make the scheduler tickless #201

Merged
merged 1 commit into from
Jun 7, 2024
Merged

Make the scheduler tickless #201

merged 1 commit into from
Jun 7, 2024

Commits on Jun 7, 2024

  1. Tickless scheduler

    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 second form and so this is the default.
    
    This reduces the time taken to run the test suite on Sonata by around
    30% and in the Ibex SAFE simulator by 13%.
    davidchisnall committed Jun 7, 2024
    Configuration menu
    Copy the full SHA
    45e0f29 View commit details
    Browse the repository at this point in the history