GoConqr has a new look! Let us know what you think.

Quiz

OS final

Duncan Levings 42 questions

Take the quiz

This quiz has question types that open in the usual player.

Questions in this quiz (42)

  1. 1Deadlocks
    Multiprogramming environment characterized by several process competing for a limited number of resources
    1. ATrue
    2. BFalse
  2. 2Deadlock can arise if four conditions hold simultaneously
    1. AMutual exclusion
    2. BHold and wait
    3. CNo preemption
    4. DCircular wait
    5. ERecursive wait
    6. FMutual Inclusion
  3. 3Deadlock Characterization

    [blank_start]Mutual exclusion[blank_end] - Only one process at a time can use a resource

    [blank_start]Hold and wait[blank_end] - A process holding at least one resource is waiting to acquire additional resources held by other processes

    [blank_start]No preemption[blank_end] - A resource can be released only voluntarily by the process holding it, after that process has completed its task

    [blank_start]Circular wait[blank_end] - There exists a set {P0, P1, ..., Pn} of waiting processes
    1. AMutual exclusion
    2. BHold and wait
    3. CNo preemption
    4. DCircular wait
  4. 4Rule of Thumb for Deadlock

    If graph contains no cycles = no deadlock

    If graph contains a cycle (closed cycle):
    if only one instance per resource type = Deadlock
    if several instances per resource type = Possibility of deadlock
    1. ATrue
    2. BFalse
  5. 5.Image for question 5
    1. AY
    2. B.
  6. 6.Image for question 6
    1. AY
    2. B.
  7. 7The deadlock-avoidance algorithm is based on resource-allocation state

    The # of available resources + allocated resources + maximum demands of the processes
    1. ATrue
    2. BFalse
  8. 8Safe State
    If a system is in safe state = no deadlocks
    If a system is in unsafe state = possibility of deadlock
    1. ATrue
    2. BFalse
  9. 9https://www.youtube.com/watch?v=w0LwGqffUkg

    Bankers Algorithm - Safety:

    1) Let Work and Finish be vectors of length ‘m’ and ‘n’ respectively.
    Initialize: Work = Available
    Finish[i] = false; for i=1, 2, 3, 4….n

    2) Find an i such that both
    a) Finish[i] = false
    b) Needi <= Work
    if no such i exists goto step (4)

    3) Work = Work + Allocation[i]
    Finish[i] = true
    goto step (2)

    4) if Finish [i] = true for all i
    then the system is in a safe state
    1. ATrue
    2. BFalse
  10. 10Bankers Algorithm - resource request

    1) If Requesti <= Needi
    Goto step (2) ; otherwise, raise an error condition, since the process has exceeded its maximum claim.

    2) If Requesti <= Available
    Goto step (3); otherwise, Pi must wait, since the resources are not available.

    3) Have the system pretend to have allocated the requested resources to process Pi by modifying the state as
    follows:
    Available = Available – Requesti
    Allocationi = Allocationi + Requesti
    Needi = Needi– Requesti
    1. ATrue
    2. BFalse

Information

Description
Computer Science Quiz on OS final, created by Duncan Levings on 27/11/2019.
Language
English
Views
3
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?