Skip to content
Snippets Groups Projects
Commit c01b066d authored by Sasan Golchin's avatar Sasan Golchin Committed by Federico
Browse files

Aperiodic Timer - Tickless Kernel


The kernel's API has been amended such that the periodic context
switch works along with exact awakening of the sleeping threads:

1) SleepData is not in terms of kernel's tick anymore but directly
in terms of context switch timer tick.
2) Sleeping threads are being awakened in the time they have requested
rather than just waiting for the context switch to happen.
3) Three functions are added to the kernel's API:
-tickSleepUntil(tick) which is private to the kernel and is the main
reference of other sleep functions of a thread and it's implemented as
an inline function to keep both maintainability and efficiency
-Thread::nanoSleep
-Thread::nanoSleepUntil

4) Besides sleep functions, the following functions has been updated
in order to keep the timer interrupt sync with the head of the sleeping
list.
I'm not sure about this being correct and it may have some conflicts
with the scheduler's policy:
-IRQwakeThreads: After removing the head of the sleeping list, the next
interrupt should be set to the head again! Another change in this
is that it does not expect the exact equivalence between timer's tick
and wakeup_time as when the kernel reaches that particular point the
timer's tick has already passed the wakeup_time.
-IRQaddToSleepingList: Due to the change in order of items in the
sleeping list, the interrupt should be set again.

5) Constructor and Interrupt handler of the context switch timer has
been amended in order to put the next context switch time as a record
in the sleeping list.

As the meaning of tick in sleep functions has been changed, the
test suit does not work properly with option t anymore but some critical
tests has been done on the current state of the project and everything
seems to work fine but some optimizations are needed specially in the
case that the time window between items in the list is very short.

Signed-off-by: default avatarSasan Golchin <ahmad.golchin@mail.polimi.it>
Signed-off-by: default avatarTerraneo Federico <fede.tft@miosix.org>
parent 2a0bfc50
Branches
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment