<operating system, parallel> A type of multitasking
where the scheduler
can interrupt and suspend ("swap out") the currently running task in order to start or continue running ("swap in") another task.
The tasks under pre-emptive multitasking can be written as though they were the only task and the scheduler
decides when to swap them.
The scheduler must ensure that when swapping tasks, sufficient state is saved and restored that tasks do not interfere.
The length of time for which a process runs is known as its "time slice
" and may depend on the task's priority or its use of resources such as memory and I/O.
and the Amiga
use pre-emptive multitasking.
This contrasts with cooperative multitasking
where each task must include calls to allow it to be descheduled periodically.