Homebrew Multitasking

Taking the scheduler a step further is to allow tasks to be suspended as needed in the middle of execution, without the task voluntarily giving up its CPU time. This scheme is known as a preemptive multitasking scheduling scheme. Preemptive multitasking involves an interrupt mechanism which can suspend the currently executing task and use the scheduler to determine which task should execute next. Tasks are no longer dependent on each others timing, so this means increased flexibility for the developer.

However, developing a homebrewed system for handling a preemptive multitasking scheme is orders of magnitude more complex than the other schemes discussed above. Deep knowledge and insight into the CPU, registers, and RAM architecture is needed to be able to develop a good preemptive multitasking system. The AspenCore EE|Times/embedded.com 2017 Embedded Markets Study shows that almost 1 in 5 applications that run a scheduling system run on an in-house/custom scheduler.