You are on page 1of 13

06 -WALKING & CHEWING GUM

C226-OPERATING SYSTEM CONCEPTS


Team 01: James, Kiang Kiat, Beryl & Cheryl
CONTENT
 3 Methods
 Pros & Cons

 Application to Problem Statement

 Process

 Process Execution

 Context Switch
DEFINITION
First in first out
This expression describes the principle of a queue processing technique what
comes in first is handled first, what comes in next waits until the first is
finished, etc.

Shortest remaining time

The process with the smallest amount of time remaining until


completion is selected to execute.

Round-robin scheduling

Assigns time to each process in equal portions and in


circular order, handling all processes without priority
PROS AND CONS
PROS CONS
RR(Round-robin) Fastest average response time, waiting high waiting times, deadlines
time is dependent on number of are rarely met in a pure RR
processes system
FCFS(First Come Turnaround time, waiting time and No prioritization occurs, thus
First Serve) response time can be low this system has trouble
meeting process deadlines.
SJF(Shortest Job No particular attention is given to Waiting time and response
First) deadlines, the programmer can only time increase as the process'
attempt to make processes with computational requirements
deadlines as short as possible. increase.
FIRST COME FIRST SHORTEST JOB FIRST
SERVE

ROUND ROBIN PRIORITY


COMPARISON
FCFS Shortest Round Robin Priority
2609 2447 2641 2569

FASTEST SLOWEST
3 DIFFERENT METHODS
APPLICATION TO PROBLEM STATEMENT
PROCESS
•A process is an instance of a computer program that is being executed.
•It contains the program code and its current activity.
•Depending on the operating system (OS), a process made up of multiple threads of
execution instructions concurrently.

Many processes are


running, and it help
driving the hardware.
PROCESS EXECUTION
As soon as a process has been
created, the system assigns it a
state. A process can be in one of
several states. 
PROCESS STATES
Created : When a process is first created, it occupies the "created" or "new" state. In
this state, the process awaits admission to the "ready" state

Waiting : A "ready" or "waiting" process has been loaded into main memory and is
awaiting execution on a CPU

Running : A "running", "executing" or "active" process is a process which is currently


executing on a CPU

Blocked : Should a process "block" on a resource (such as a file or a device), it will


transit from “running” state to “blocked” state. The process will remain "blocked" until
its resource becomes available

Terminated : A process may be terminated, either from the "running" state by


completing its execution or by explicitly being killed
CONTEXT SWITCHING
The computing process of storing and restoring state of a CPU so that execution can
be resumed from the same point at a later time.

• Multiple processes to share a single CPU


Context switches are usually computationally intensive and much of the design of
operating systems is to optimize the use of context switches.

•It can mean a register context switch, a task context switch, a thread context switch,
or a process context switch.
WHEN TO SWITCH?
 Multi-tasking
 Interrupt handling

 User and Kernel mode switching

You might also like