CSC4320 quez3

Embed Size (px)

Citation preview

  • 7/23/2019 CSC4320 quez3

    1/2

    CSC4320/6320 Quiz3

    Name:_______________________

    Question1:Explain the followin te!minolo":

    1# $a%e Con&ition '10()2# C!iti%al se%tion* $emain&e! se%tion '1+()

    3# ,ea&lo%- '10()

    4# Sta!.ation '10()+# onito! '1+()

    Race Condition: se.e!al p!o%esses a%%ess an& manipulate the same &ata

    %on%u!!entl" an& the out%ome of the exe%ution &epen&s on the pa!ti%ula! o!&e! in

    whi%h the a%%ess ta-es pla%e#

    Consi&e! a s"stem with np!o%esses* ea%h of them has a sement %o&e* %alle&

    critical section* in whi%h the p!o%ess ma" e %hanin %ommon .a!iales*

    up&atin a tale* w!itin a fileet%# he se%tion of %o&e implementin this !euest is the entry section

    he %!iti%al se%tion ma"e followe& " an exit section

    he !emainin %o&e is the remainder section

    ,ea&lo%- two o! mo!e p!o%esses a!e waitin in&efinitel" 'fo!e.e!) fo! an e.ent

    that %an e %ause& " onl" one of the waitin p!o%esses

    Sta!.ationin&efinite 'fo!e.e!) lo%-in# 5 p!o%ess ma" ne.e! e !emo.e& f!om

    the semapho!e ueue in whi%h it is suspen&e

    5 hihle.el ast!a%tion that p!o.i&es a %on.enient an& effe%ti.e me%hanism fo!

    p!o%ess s"n%h!onization# 7nl" one p!o%ess ma" e a%ti.e within the monito! at a

    time

  • 7/23/2019 CSC4320 quez3

    2/2

    Question2:

    2#1 8e %onsi&e! a s"stem %onsistin of two p!o%esses* 90 an& 91* ea%h a%%essin two

    semapho!es* S an& Q* set to the .alue 1#

    90 91

    8ait'S) 8ait'S)

    8ait'Q) 8ait'Q)

    Sinal'S) Sinal'Q)Sinal'Q) Sinal'S)

    ,oes this ha.e the %han%e to o%%u! &ea&lo%- situation'+() Explain "ou! answe! '1+()

    N7

    2#2 8e %onsi&e! a s"stem %onsistin of two p!o%esses* 90 an& 91* ea%h a%%essin two

    semapho!es* S an& Q* set to the .alue 1#

    90 91

    8ait'S) 8ait'Q)

    8ait'Q) 8ait'S)

    Sinal'S) Sinal'Q)Sinal'Q) Sinal'S)

    ,oes this ha.e the %han%e to o%%u! &ea&lo%- situation'+() Explain "ou! answe! '1+()

    ;ES