zephyr/arch/x86/include
Benjamin Walsh 35497d6c5e unified: cache the next thread to run
When adding a thread to the ready queue, it is often known at that time
if the thread added will be the next one to run or not. So, instead of
simply updating the ready queues and the bitmask, also cache what that
thread is, so that when the scheduler is invoked, it can simply fetch it
from there. This is only done if there is a thread in the cache, since
the way the cache is updated is by comparing the priorities of the
thread being added and the cached thread.

When a thread is removed from the ready queue, if it is currently the
cached thread, it is also removed from the cache. The cache is not
updated at this time, since this would be a preemptive fetching that
could be overriden before the newly cached thread would even be
scheduled in.

Finally, when a thread is scheduled in, it now becomes the cached thread
since the fact that it is running means that by definition it was the
next one to run.

Doing this can speed up considerably some context switch times,
especially when a thread is preempted by an interrupt and the same
thread is scheduled when the interrupt exits.

Change-Id: I6dc8391cfca566699bb9b217eafe6bc6a063c8bb
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-10 21:27:31 +00:00
..
debug debug: add target GDB server 2016-04-16 05:29:22 +00:00
asm_inline.h
asm_inline_gcc.h x86: improve exception APIs 2016-07-28 18:13:24 +00:00
cache_private.h c++: Add extern "C" { } block to header files 2016-02-05 20:25:22 -05:00
exception.h x86: exceptions: simplify exception stubs 2016-09-28 20:28:07 +00:00
kernel_event_logger_arch.h x86: declare internal API for interrupt controllers 2016-09-06 18:35:47 +00:00
nano_private.h unified: cache the next thread to run 2016-10-10 21:27:31 +00:00
start_task_arch.h c++: Add extern "C" { } block to header files 2016-02-05 20:25:22 -05:00
swapstk.h c++: Add extern "C" { } block to header files 2016-02-05 20:25:22 -05:00