-Process Management Ppt

Embed Size (px)

Citation preview

  • 7/25/2019 -Process Management Ppt

    1/30

    Process management

    Allocates resources to processes

    Enables processes to share and exchange

    information

    Protects the resources of each process from

    other processes

    Provides facilities for process sharing and

    synchronization

    Schedules the work done by the processor

  • 7/25/2019 -Process Management Ppt

    2/30

    Process

    an instance of a program in execution

    Program

    consists of only 3 statements

    can either be !" bound

    #P$ bound

  • 7/25/2019 -Process Management Ppt

    3/30

    %igure 3&'

    Process State (ransition )iagram

  • 7/25/2019 -Process Management Ppt

    4/30

    Process Scheduler

    3 (ypes of schedulers

    *ong+term scheduler ,-ob ! admission.

    Short+term scheduler ,cpu.

    /edium+term scheduler ,/idterm.

  • 7/25/2019 -Process Management Ppt

    5/30

    "S Scheduler

    *ong+term Scheduler

    )ecides which of the new processes

    are added to the pool of processes

    ready for execution0

    and determines which of the

    processes is to be released orterminated

  • 7/25/2019 -Process Management Ppt

    6/30

    /edium+term Scheduler

    )ecides which of the processes

    should be partially or fully loaded0

    suspended or to resume in the main

    memory

  • 7/25/2019 -Process Management Ppt

    7/30

    Short+term Scheduler

    )ecides as to which of the available

    processes will be allotted the

    processor and for how long

  • 7/25/2019 -Process Management Ppt

    8/30

    Process Scheduling

    #P$ Scheduling

    se1uence or order of process

    execution as they are allotted the

    processor&

    #P$ Scheduling Algorithm

    (he many ways of allotting the

    processor to a specific -ob or process

  • 7/25/2019 -Process Management Ppt

    9/30

    (he main purposes of scheduling

    algorithms are

    to minimize resource starvation

    to ensure fairness among the parties

    utilizing the resources

  • 7/25/2019 -Process Management Ppt

    10/30

    Evaluation #riteria of the best

    #P$ scheduling algorithm

    ncrease #P$ $tilization

    /ake #P$ busy processing at all times

    2 time the processor is busy

    ncrease throughput

    measures how much work is done in a given time

    educe (urn+around time

    amount of time to execute a particular process

    educe 4aiting time amount of time in the ready 1ueue before alloted cpu time

    educe esponse time Amount of time from re1uest until the first response

  • 7/25/2019 -Process Management Ppt

    11/30

    #P$ Scheduling Algorithms

    ' categories of #P$ Scheduling algorithms

    5on Preemptive algorithm

    once the process is in the running state0 itwill continue until the halted state&

    Preemptive algorithm currently running process may be interrupted

    and moved to the ready state even if the total

    burst time has not been consumed&

  • 7/25/2019 -Process Management Ppt

    12/30

    #P$ Scheduling Evaluation

    6antt chart 7 shows execution pattern

    (urn+around (ime

    4aiting (ime

    #P$ $tilization

  • 7/25/2019 -Process Management Ppt

    13/30

    #P$ Scheduling algorithms

    %irst #ome %irst Serve ,%#%S.

    Shortest 8ob %irst ,S8%.

    5on+Preemptive Priority ,5PP.

    Preemptive Priority ,PP.

    Shortest emaining (ime %irst ,S(%. ound obin ,.

  • 7/25/2019 -Process Management Ppt

    14/30

    Problem 9

    Job Arrival Time Burst Time Priority

    89 : 93 ;

    8' 3 < 3

    83 = ; 9

    8< 9? @ '

  • 7/25/2019 -Process Management Ppt

    15/30

    %irst #ome %irst Serve

    also known as first in0 first out ,fifo.

    allocates processor based on time of arrival

    very simple implementation

    low overhead

    waiting time depends on arrival order0 exhibits

    convoy effect

    possible long wait for -obs that arrived later ,poor

    performance.

  • 7/25/2019 -Process Management Ppt

    16/30

    Shortest 8ob %irst

    allocates processor based on the shortest cpu burst

    ready 1ueue is treated as a priority 1ueue based on smallest

    time re1uirement

    also called shortest -ob next ,s-n. uses fcfs if -obs are of the same length of burst

    moving shorter -obs before longer -obs improves waiting time

    of short -obs more than it harms waiting time of long -obs&

    optimal with regard to turn+around and waiting time

    not practical0 cannot predict future cpu burst time

    long -obs may never be scheduled0 thus starvation occurs

  • 7/25/2019 -Process Management Ppt

    17/30

    Priority algorithm

    sometimes called highest priority first ,hpf.

    each -ob is assigned a priority where -obs are

    scheduled based on the highest priority

    static priority will work well for real time slice while

    dynamic priority will work well for general workload&

    high priority -obs will be processed first

    there is a possibility that low priority -obs will starve&

  • 7/25/2019 -Process Management Ppt

    18/30

    Shortest emaining (ime %irst

    also called shortest time to completion

    ,stcf.

    allocates processor based on theshortest remaining burst and pre+

    empting if a shorter burst is found in

    the ready 1ueue

  • 7/25/2019 -Process Management Ppt

    19/30

    ound obin

    allocates the processor based on a given time slice or

    1uantum&

    treats the ready 1ueue as a circular 1ueue wherein

    arriving -obs or -obs preempted are placed on the tail

    of the 1ueue&

    simple0 low overhead0 work for interactive -obs

    -ob gets fair share of cpu

    shortest -ob finishes more 1uickly

    poor average waiting time with similar -ob lengths

    performance depends on length of time slice

    higher overhead

  • 7/25/2019 -Process Management Ppt

    20/30

    Problem '

    ProcessArrivalTime

    BurstTime

    Priority

    A : ; 3 > = '

    # > 3 ;

    ) = @ 9

    E 9: >

    ProcessArrivalTime

    BurstTime

    Priority

    A : 9: ; 7 3 1

    # 5 8 2

    ) 2 4 1

    E 3 9 3

  • 7/25/2019 -Process Management Ppt

    24/30

    Problem ?

    Job Arrival Time Burst Time Priority

    A : 99 ; '

    # 9= 9 3

    ) 3< @ ;

    E > 9< 9

    % 9; 93 >

    6 '> 99 3

    B < ' '

    3: > 9

  • 7/25/2019 -Process Management Ppt

    25/30

    MULTILEVEL QUEUE SCHEDULI! AL!"#ITHM

  • 7/25/2019 -Process Management Ppt

    26/30

    MULTILEVEL QUEUE SCHEDULI! AL!"#ITHM

    A process is assigned a 1ueue level based on memory size0

    process priority or process type&

    Each level has its own defined scheduling algorithm&

    (he order of processing in between 1ueue levels may bebased onC

    priority using either non pre+emptive or pre+emptive policy&

    *ower 1ueue levels will only be able to run when all the

    higher level 1ueues are empty&

    Duantum or time slice where 1ueue levels are given specifiedtime slice in the central processing unit

  • 7/25/2019 -Process Management Ppt

    27/30

    MULTILEVEL $EEDBAC% QUEUE &M$Q'

  • 7/25/2019 -Process Management Ppt

    28/30

    MULTILEVEL $EEDBAC% QUEUE &M$Q'

    (he number of 1ueues should be defined&

    Each 1ueue has a defined scheduling algorithm

    used

    (here must be a policy used to decide when to

    move up a process

    (here must be a policy used to decide when to

    move down a process

    (here must be a policy used to decide in what

    1ueue a process will enter when it needs service&

  • 7/25/2019 -Process Management Ppt

    29/30

    P"*E/ =

    D: *"4 S8%

    D9 B6B %#%S

    Process

    Arrival

    Time

    Queue

    LevelBurst Time

    P9 : D:

  • 7/25/2019 -Process Management Ppt

    30/30

    Problem @

    *EE* : DF '

    *EE* 9 DF ;

    *EE* ' S8%

    ProcessArrivalTime

    Burst Time

    A : 99

    > 9>

    % 9; 93

    6 '> 9: