Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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),

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 entry or exit section. For each fragment, state whether mutual exclusion still holds. If it doesnt, show an execution sequence that violates it. State whether deadlock can occur. If it can, show an execution sequence that produces it. (b) Process P1 Process P2 do signal(mutEx); critical section wait(mutEx); remainder section while (!done1); do signal(mutEx); critical section wait(mutEx); remainder section while (!done2); (c) Process P1 Process P2 do wait(mutEx); critical section signal(mutEx); remainder section while (!done1); do wait(mutEx); critical section wait(mutEx); remainder section while (!done2); (d) Process P1 Process P2 do wait(mutEx); critical section signal(mutEx); remainder section while (!done1); do wait(mutEx); critical section remainder section while (!done2); (e) Process P1 Process P2 do wait(mutEx); critical section signal(mutEx); remainder section while (!done1); do critical section signal(mutEx); remainder section while (!done2); Section An operating system has processes P1, P2, P3, and P4 and resources R1 (one resource), R2 (one resource), R3 (two resources), and R4 (three resources). The notation (1, 1), (2, 2), (1, 2) means that P1 requests R1, then P2 requests R2, then P1 requests R2. Note that the first two requests produce allocation edges on the resource allocation graph, but the third request produces a request edge on the graph because R2 is already allocated to P2. Draw the resource allocation graph after each sequence of requests. State whether the graph contains a cycle. If it does, state whether it is a deadlock cycle. (c) (1, 1), (2, 1), (3, 1), (4, 1) (d) (3, 3), (4, 3), (2, 2), (3, 2), (2, 3) (e) (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4) (f) (2, 1), (1, 2), (2, 3), (3, 3), (2, 2), (1, 3) (g) (2, 1), (1, 2), (2, 3), (3, 3), (2, 2), (1, 3), (3, 1) (h) (1, 4), (2, 3), (3, 3), (2, 1), (3, 4), (1, 3), (4, 4), (3, 1), (2, 4) (i) (1, 4), (2, 3), (3, 3), (2, 1), (3, 4), (1, 3), (4, 4), (3, 1), (2, 4), (4, 3)

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

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

=+5. What do you want them to think?

Answered: 1 week ago

Question

What is focal length? Explain with a diagram and give an example.

Answered: 1 week ago

Question

What is physics and how does it apply in daily life?

Answered: 1 week ago