Question

Answer the following question: Process p1 needs to access resources r1, r2, r3, in some order. Process p2 needs to access res

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here, r1 for p1, and r4 for p2, are independent resources needed by independent processes, so we don't need to worry about r1 and r4.

Both processes p1 and p2 require r2 and r3 as common resources, and thus a deadlock might be formed whenever any one of the following occurs :

  • p1 acquires r2 first and waits for r3, and p2 acquires r3 first and waits for r2, OR
  • p1 acquires r3 first and waits for r2, and p2 acquires r2 first and waits for r3

Occurrence of any of the above is a cyclical dependency and thus could lead to deadlock.

We investigate each case one by one.

i)

P1: r1, r3, r2

P2: r2, r3, r4

Here, P1 acquires r3, and waits for r2.

Also, P2 acquires r2, and waits for r3.

Deadlock possible -> YES

ii)

P1: r1, r2, r3

P2: r2, r3, r4

Here, P1 acquires r2, and waits for r3.

Also, P2 acquires r2, and waits for r3.

Deadlock possible -> NO

iii)

P1: r2, r1, r3

P2: r3, r2, r4

Here, P1 acquires r2, (then r1) and waits for r3.

Also, P2 acquires r3, and waits for r2.

Deadlock possible -> YES

iv)

P1: r3, r2, r1

P2: r3, r4, r2

Here, P1 acquires r3, and waits for r2.

Also, P2 acquires r3, (then r4) and waits for r2.

Deadlock possible -> NO

Thus, the options to select are :

1st option :

P1: r1, r3, r2

P2: r2, r3, r4

3rd option :

P1: r2, r1, r3

P2: r3, r2, r4

Add a comment
Know the answer?
Add Answer to:
Answer the following question: Process p1 needs to access resources r1, r2, r3, in some order....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Given the table, suppose we have avoided circular-wait by ordering the resources in the order R1...

    Given the table, suppose we have avoided circular-wait by ordering the resources in the order R1 -> R2 -> R3 -> R4 and enforcing that each process must request resources in the ascending order. Show one allocation possibility of R1-R4 to P1-P4 and the corresponding wait-for graph. If there is a deadlock, please explain why or why not? Resource No. of instances Requested Allocated R1 2 P1, P2 ? R2 1 P1, P3 ? R3 1 P3, P4 ? R4...

  • a. A system has two processes and three identical resources. Each process needs a maximum of...

    a. A system has two processes and three identical resources. Each process needs a maximum of two resources. Is deadlock possible? Explain your answer. b. A system has 4 processes, P1 through P4, and 5 types of resources, R1 through R5. Existing resource vector E = (3, 2, 1, 2, 2) Current allocation matrix C = R1 R2 R3 R4 R5 P1 1 1 0 0 0 P2 0 0 1 0 0 P2 1 0 0 20 P4 0...

  • (1) Having the following sets: [2 marks] P: P1, P2, P3 R: R1, R2, R3 E:...

    (1) Having the following sets: [2 marks] P: P1, P2, P3 R: R1, R2, R3 E: P1→R2, P2→R1 R1→P1, R2→P2, R3→P3 Draw the resource allocation graph of the previous system? Examine if the system deadlocked or not and list all the cycles?

  • 5. Provide the Need table for the following Processes Process Allocated Maximum R1 R2 R3 R4...

    5. Provide the Need table for the following Processes Process Allocated Maximum R1 R2 R3 R4 R1 R2 R3 R42 РОe 02122212 552527 P12 120 121 2 324344-12 P2 1212222222222232 P3 1 2022 252 42 325 P44 12010026825272 Process Available. R14 R2 R3 R4 POH 2 2012 () Using the Banker's algorithm, determine if the system is in a safe state, and if so, state the safe sequence.

  • Answer units Question 11 (1 point) R3 In the following circuit, R1-40.2 Ohm, R2-2* 7.02 Ohm,...

    Answer units Question 11 (1 point) R3 In the following circuit, R1-40.2 Ohm, R2-2* 7.02 Ohm, R3-3° 7.02 Ohm, R4-27.02 Ohm, and E= 40.2 Volt. Calculate the current in R3 resistor? (Picture File-Ohm-3.jpg] Your Answer: Answer units Question 12 (1 point) Saved

  • why is R1 and R3 in series and not parallel? please help with calculations in this question. thanks! 23) Which of the following statements are true about the circuit below? I. R2 and R4 are in...

    why is R1 and R3 in series and not parallel? please help with calculations in this question. thanks! 23) Which of the following statements are true about the circuit below? I. R2 and R4 are in series. II. R2 and R4 are in parallel. IlI. R1 and R3 are in parallel. (D 150-Rv 24V 4,00-RJ D) L III A) I B) II C) III E-9 20) Which statements are true for the circuit shown in the figure below? The emf...

  • Let I represent an execution of init(s), W of wait(s), and S of signal(s). Then, for...

    Let I represent an execution of init(s), W of wait(s), and S of signal(s). Then, for example, IWWS represents the sequence of calls init(s), wait(s), wait(s), and signal(s) by some processes in an operating system. For each of the following sequences of calls, state the value of s and the number of processes blocked after the last call in the sequence: (b) IS (c) ISSSW (d) IWWWS (e) ISWWWW Each of the following code fragments contains a bug in the...

  • Need help answer these problems I got some answered but not sure if there correct answers....

    Need help answer these problems I got some answered but not sure if there correct answers. Any help appreciated. Read the case describing the cross-selling of insurance policies, and answer the corresponding questions about the managers response Case Barrett Bennett just graduated from college, and now works for an insurance company. The national broker for the insurance company has set lofty goals around cross selling. Specifically, agents receive bonuses and accolades for successful cross selling to current customers. The goal...

  • Need help answering these questions some I answered but not for sure. Any help appreciated. Read...

    Need help answering these questions some I answered but not for sure. Any help appreciated. Read the case describing the cross-selling of insurance policies, and answer the corresponding questions about the managers response Case Barrett Bennett just graduated from college, and now works for an insurance company. The national broker for the insurance company has set lofty goals around cross selling. Specifically, agents receive bonuses and accolades for successful cross selling to current customers. The goal is that if a...

  • Hi, I am requesting your help. Some of those that I am not sure if I...

    Hi, I am requesting your help. Some of those that I am not sure if I am right? Thank you, Michelle ________________________________ You work at Ford Motor Company and are responsible for determining weekly production capacity for the Juarez, Mexico assembly plant. There are 21 days left in the production month. Your sales manager just informed you that 4,725 vehicles need to be produced in the upcoming days to meet projected sales demand in the United States 21. Your production...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT