Program X Return to int.handlr Start User Pgm Interrupt Handler Find cause int. Control Unit
Interrupt Handler Based System Command interpreter User program File manager A.B.L. Interrupt handler
active waiting for cpu blocked task completed start I/O preemption activation load swap out I/O completion (interrupt) Multi-task Systems
Multitasking Issues Process Scheduling Which program becomes active when ? Job Scheduling (or Queue Management) Which programs reside in Central Memory ? Memory Management How much memory gets each program ? Output Spooling How to keep output of programs apart ?
Process Scheduler All programs have a priority and the one waiting with the highest priority becomes active. Non-preemptive Scheduling: Priorities are compared whenever the active program blocks itself a clock tick occurs (typically every 10 mS) Preemptive Scheduling Priorities are continuously compared.
Process Priorities active blocked +1 p = p 0 waiting for cpu +1
Job Scheduler Selects the programs to be loaded in Central Memory Manual selection (starting an application under Windows) Automatic selection –based on priorities –Based on the Round Robin algorithm
Round Robin Central memory Preempted tasks after t seconds New tasks Input queue Completed tasks
Memory Management Allocates memory to each program –Static Allocation Good Job Scheduling mandatory. –Dynamic Allocation: Virtual Memory Job Scheduling not so important.