Saturday, August 2, 2008

DIFFERENCES BETWEEN PREEMPTIVE AND NON-PREEMPTIVE

Non-Preemptive: Non-preemptive algorithms are designed so that once a process enters the running state(is allowed a process), it is not removed from the processor until it has completed its service time ( or it explicitly yields the processor). context_switch() is called only when the process terminates or blocks.

Preemptive: Preemptive algorithms are driven by the notion of prioritized computation. The process with the highest priority should always be the one currently using the processor. If a process is currently using the processor and a new process with a higher priority enters, the ready list, the process on the processor should be removed and returned to the ready list until it is once again the highest-priority process in the system

Non-Preemptive: Non-preemptive algorithms are designed so that once a process enters the running state(is allowed a process), it is not removed from the processor until it has completed its service time ( or it explicitly yields the processor). context_switch() is called only when the process terminates or blocks.

Preemptive: Preemptive algorithms are driven by the notion of prioritized computation. The process with the highest priority should always be the one currently using the processor. If a process is currently using the processor and a new process with a higher priority enters, the ready list, the process on the processor should be removed and returned to the ready list until it is once again the highest-priority process in the system.

2 comments:

Upendra said...

You know what? U really helped me a day before my exam.... I'm a concept freak & can't mug-up.. was looking whether non pre-emptive scheduling falls under multi-processing or not.. and hence whether context_switch is used or not.. and it was true.
Though non pre-emp scheduling confuses because it runs one process at a time (per processor), but still multi prog is possible asa it's finished or waiting, and context_switch() is called..

But I wanna know one more thing, as interrupts are mostly seen in interrupt based data transfer scheme, where CPU saves process and executes interrup service routine (means it's not available for other processes), does it mean other interrupts are also there (like another process interrupting)?

Haseeb Iqbal said...

preemtive you define is confusing