Pre-emption as used with respect to
operating systems means the ability of the operating system to preempt or stop a currently scheduled task in favour of a higher priority task. The scheduling may be one of, but not limited to,
process or
I/O scheduling, among others.Non-preemptability arises, for instance, when handling an
interrupt. In this case, scheduling is avoided until the interrupt is handled. Making a
scheduler preemptible has the advantage of better system responsiveness and scalability, but comes with the disadvantage of racing conditions (where the executing process access the same resource before another (preempted) process finished using it).
See more at Wikipedia.org...
<
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.
OS/2,
Unix 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.
(1995-03-20)