Concurrency and timeslices

A different approach consists of assigning short intervals of the CPU time to each task, and continuously swapping processes at a very short interval. A preemptive scheduler autonomously interrupts the running task to resume the next one without an explicit request from the task itself, and can impose its policy regarding the selection of the next task to run and the duration of the interval where the CPU is assigned to each task, namely its timeslice.

From the task's point of view, the execution can now be continuous and completely independent from the scheduler, which acts behind the scenes to interrupt and resume each task continuously, giving the illusion that all the tasks are actually running at the same time. ...

Get Embedded Systems Architecture now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.