Presentation is loading. Please wait.

Presentation is loading. Please wait.

Process A program in execution. But, What does it mean to be “in execution”?

Similar presentations


Presentation on theme: "Process A program in execution. But, What does it mean to be “in execution”?"— Presentation transcript:

1 Process A program in execution

2 But, What does it mean to be “in execution”?

3 Process States New ReadyRunning Terminated Waiting Admitted Exit I/O or Event Completion Scheduler Dispatch I/O or Event Wait Interrupt

4 What to keep track of?

5 Process Control Block Process Number Program Counter I/O Status Info Registers Memory Limits Accounting Info Scheduling Info

6 Process Scheduling Choose processes for execution (ready Q) Decide which process goes from ready to running

7 Context Switch Change “running” process Move info from running job to PCB? Move info for new job from PCB into registers, PC etc. Typical time about 1  sec

8 Types of Schedulers Short term CPU Scheduler Selects from ready Q Runs every few milliseconds Must be quick/small Long term scheduler Controls degree of multiprogramming Balance CPU-bound, I/O-bound processes Decide what goes into ready Q?

9 Scheduling Algorithms Metrics CPU utilization (%) Throughput – jobs completed/time Turnaround time Submission to completion Waiting time Time in ready queue Response time Interactive systems

10 Scheduling Algorithms First-Come, First-Served Shortest-Job-First Priority Round-Robin Multilevel Queue

11 First-Come, First-Served Non-preemptive Process must voluntarily relinquish by terminating or by making a system call Intrinsic priority: Arrival time Expected performance ? Limitations ? Benefits ?

12 Shortest-Job-First Non-preemptive Better response for short jobs Provably optimal min avg. waiting time for a pool of jobs Disadvantage(s) ?

13 Priority Associate priority with each process One queue for each priority level FCFS within each level Problem(s) with priority? SJF is special case

14 Priority Starvation possible Solution? Increase priority with “age” Implement aging ? Nice (Unix)

15 Round-Robin Preemptive Process “runs” time-slice (q) units FCFS special case of RR (q = infinity) Time sharing Each process “executes” at speed 1/n. q = ??? Balance q with context switch time

16 Multilevel Queues Partition Ready Queue Each Q has own schedule method E.g. foreground (interactive, RR) and background (batch, FCFS) queues Approaches Higher queues have absolute priority over lower level queues OR Time slice among queues

17 Evaluation Modeling Deterministic - Requires exact numbers Queueing - Uses distribution of bursts Simulation Create software models of systems. Lots of work, time consuming Actual implementation & test Cost May change behavior


Download ppt "Process A program in execution. But, What does it mean to be “in execution”?"

Similar presentations


Ads by Google