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.

7 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)?

Unknown said...

preemtive you define is confusing

Unknown said...

exactly to the point and exact difference has written..

puja kandakur said...

Yeah same hea .....

puja kandakur said...

Thanq so much fo dis stuff.....
I was confused by d explanation in d text its simple n gud

Unknown said...

Thank you so much ji.....

Unknown said...

Yeah, thank you, i have got what i am looking for.