You are on page 1of 10

WHAT IS AN OPERATING SYSTEM?

An interface between users and hardware - an environment "architecture Allows convenient usage; hides the tedious stuff Allows efficient usage; parallel activity, avoids wasted cycles Provides information protection Gives each user a slice of the resources Acts as a control program

Scheduling Criteria
Selects from among the processes in memory that are

ready to execute, and allocates the CPU to one of them


CPU scheduling decisions may take place when a process:

1. Switches from running to waiting state 2. Switches from running to ready state 3. Switches from waiting to ready 4. Terminates
Scheduling under 1 and 4 is nonpreemptive All other scheduling is preemptive

Scheduling Criteria
CPU utilization keep the CPU as busy as possible (from 0% to 100%) Throughput Number of processes that complete their execution per time unit Turnaround time amount of time to execute a particular Process Waiting time amount of time a process has been waiting in the ready queue Response time amount of time it takes from when a request was submitted until the first response is produced

Optimization Criteria
Max CPU utilization Max throughput Min turnaround time Min waiting time Min Response time

Preemptive vs. Non-Preemptive


A non-preemptive scheduler runs only when the running thread gives up the processor through its own actions, e.g.,

the thread terminates the thread blocks because of an I/O or synchronization operation the thread performs a Yield system call (if one is provided by the operating system)

A preemptive scheduler may, in addition, force a running


thread to stop running. typically, a premptive scheduler will be invoked periodically by a timer interrupt handler, as well as in the circumstances listed above a running thread that is preempted is moved to the

ready state

Scheduling Algorithms
First Come First Serve Scheduling Round-Robin Scheduling Shortest Job First Scheduling Highest Response Ratio First Priority Scheduling Multilevel Queue Scheduling Multilevel Feedback-Queue Scheduling

You might also like