The difference between 'Preemptive' and 'Non-preemptive scheduling', is that Non-preemptive Scheduling occupies full control of the CPU whereas Preemptive Scheduling allows the computer's Operating System, (OS), control over the states of processes. It may help to understand a little about the different states of a computer process:
Here is an example of the former Preemptive Scheduling - if you launch a software application such as a text editor, the OS will assign the task to the processor, and will allocate disk space, memory and other resources to the program; the text editor program is now in a running state. If you decide to launch a second application and a new process is generated, various necessary resources are assigned to the new program, and the text editor is kept in a waiting or ready state until the new process has been executed.
- Process States
- New - When a process is first activated or created such as when launching a software program (we'll keep to this example throughout this explanation).
- Ready - When the program is ready to be assigned to the processor.
- Running - When the program is being executed it is known as 'running'.
- Waiting - The process here is dormant and waiting for communication from other processes.
- Terminated - The term used for when the executed process has finished.
- Preemptive Scheduling
- Non-Preemptive Scheduling
Here is an example of the former Preemptive Scheduling - if you launch a software application such as a text editor, the OS will assign the task to the processor, and will allocate disk space, memory and other resources to the program; the text editor program is now in a running state. If you decide to launch a second application and a new process is generated, various necessary resources are assigned to the new program, and the text editor is kept in a waiting or ready state until the new process has been executed.