Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Deadlock is a state when a set of blocked processes each holding a resource are waiting to acquire a resource held by another process in

Deadlock is a state when a set of blocked processes each holding a resource are waiting to acquire a resource held by another process in the set.

Deadlock can arise if the following four conditions hold simultaneously:

Mutual exclusion: only one process at a time can use a resource.

Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes.

No pre-emption: a resource can be released only voluntarily by the process holding it, after that process has completed its task.

Circular wait: there exists a set {P1, P2, ..., Pn} of waiting processes such that P1 is waiting for a resource that is held by P2, P2 is waiting for a resource that is held by P3, ..., Pn1 is waiting for a resource that is held by Pn, and Pn is waiting for a resource that is held by P1.

There are 4 choices for handling deadlocks:

Choice #1: Ensure that the system will never enter a deadlock state

  1. Deadlock Prevention - ensure that the system will never enter a deadlock state
  2. Deadlock Avoidance maintain the safe state by having the information about the maximum number of resources of each type it may need

Choice #2: Allow the system to enter a deadlock state and then recover

  1. Deadlock Detection
  2. Deadlock Recovery
    1. Process Termination -Abort all deadlocked processes, or abort one deadlocked process at a time until every deadlock cycle is eliminated. May depend upon the priority of the process or process age and remaining time or resources the process has used or resources the process needs to complete or number of processes will need to terminated or the process are interactive or batch?
    2. Resource Pre-emption by selecting a victim or Rollback by return to some safe state, i.e. restart the current process

Choice #3: Ignore and dont care

Resources may be a single instance or multiple instances. Resource allocation and wait for graph occurs for single instances generally and bankers algorithm works for multiple instances.

Q1. Given five memory partitions of 100Kb, 500Kb, 200Kb, 300Kb, 600Kb (in order), how would the first-fit, best-fit, and worst-fit algorithms place processes of 212 Kb, 417 Kb, 112 Kb, and 426 Kb (in order)? Which algorithm makes the most efficient use of memory?

Q2. Consider the following segment table:

Process Base register Limit Register

0 219 600

1 2300 14

2 90 100

3 1327 580

4 1952 96

Are the following logical addresses possible for each process? If yes, what will be the corresponding physical addresses for each process with its logical address written after comma?

a. 0,430

b. 1,10

c. 2,500

d. 3,400

e. 4,112

Q3. Suppose that we have free segments with sizes: 6, 17, 25, 14, and 19. Place a program with size 13kB in the free segment using first-fit, best-fit and worst fit?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

Explain in detail how the Mughal Empire was established in India

Answered: 1 week ago

Question

Problem: Evaluate the integral: I - -[ze dx

Answered: 1 week ago

Question

Problem: Evaluate the integral: I = 1- 1 dx 9

Answered: 1 week ago

Question

How was your life influenced by those events?

Answered: 1 week ago

Question

Which of these influenced your life most dramatically?

Answered: 1 week ago