nu er det lidt siden jeg har haft multiprogrammering, men mener at huske preemptivt = tråd kan afbrydes til enhver tid.
non-preemptiv får tråden lov til at køre til den afgiver processoren igen.
følgende er hugget fra
http://www.compapp.dcu.ie/~humphrys/OS/theory/processes.html Non-preemptive scheduler:
When process gets CPU, it keeps it until goes into Wait or terminates.
Can work on hardware which has no timer mechanism.
Can work for a multi-process system, but only for a single-user multi-process system.
This is what Windows 3 (just before Windows 95) did. The user controlled the switching. When you switched focus of the window, background process was frozen.
Preemptive scheduler:
Even though process is running happily, it simply gets interrupted by the CPU after some time.
UNIX, Windows 95 onwards.
Needs timer hardware.
Need to be careful that program can be interrupted and then resumed in consistent state. (Are files open? Is I/O in progress?)