Pre-emption is a common scheduling in time sharing systems.
Any process may be suspended at an apparently arbitrary moment to
allow some other process to run. This is often to achieve a ;SPM_quot;fair
share;SPM_quot; of processing time.
In pre-emptive operating systems, the granularity interleaving may be
as small as a single instruction.
Run-to-completion is more common in monolithic or embedded systems.
Each process runs until it has completed the current task, and then
voluntarily hands control back to a scheduler which decides which
process to run next.
In run-to-completion real time systems, the granularity of
interleaving will be decided by the programmer.
In a distributed system, there is real concurrency whether we
want it or not. This brings special problems:
In a central system, at least one component is immune from the
concurrency - the dispatcher or scheduler. In a distributed system, the
scheduler function itself is distributed.
Partial failure of a system is possible. This aspect of distribution
makes programming particularly hard. Because of the lack of tight coupling of components,
there is a lack of information
(or immediate information) under partial failure. Explicit mechanisms must be added by the distributed systems programmer to account for this, such as probes and timeout mechanisms.