i) In the code below, three processes are competing for six resources labeled A to F....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
i) In the code below, three processes are competing for six resources labeled A to F. a. Using a resource allocation graph, show the possibility of a deadlock in this implementation. b. Modify the order of some of the get requests to prevent the possibility of any deadlock. You cannot move requests across procedures, only change the order inside each procedure. Use a resource allocation graph to justify you answer. Vid Po Void Po Ved Po ( C ( While(true) While (true) While(true) ( A D (C) pr tet(11), //critical regions://critical region://critical region //use A,B,C e D.E.B // C.F.D release (A) release(D) release(C): release (B release(K) release F release (C) release releas(D) > > } etisalat 12:19 PM Dr Henna 30810 ii) The two variables a and b have initial values of 1 and 2, respectively. The following code is for Linux system: Thread Thread2 mb() b-4c-b mmb(); What possible errors are avoided by the use of the memory barriers? (2Marks) @7 28% etisalat 12:19 PM Dr Henna 30810 Questions cover CLO6: L5 Question 2 5Marks i) Consider a fixed partitioning scheme with equal-size partitions of 2^16 bytes and a total main memory size of 2^24 bytes. A process table is maintained that includes a pointer to a partition for each resident process. How many bits are required for the pointer? (1 Marks) @7 28% etisalat Dr Henna 12:19 PM 30810 prywer van vi u avganvin un va a. 0,228 b. 2,648 c. 3,776 d. 1,98 (0.5*4=2Marks) iii) Consider a dynamic partitioning scheme. Show that, on average, the memory contains half as many holes as segments. (2Marks) 28% i) In the code below, three processes are competing for six resources labeled A to F. a. Using a resource allocation graph, show the possibility of a deadlock in this implementation. b. Modify the order of some of the get requests to prevent the possibility of any deadlock. You cannot move requests across procedures, only change the order inside each procedure. Use a resource allocation graph to justify you answer. Vid Po Void Po Ved Po ( C ( While(true) While (true) While(true) ( A D (C) pr tet(11), //critical regions://critical region://critical region //use A,B,C e D.E.B // C.F.D release (A) release(D) release(C): release (B release(K) release F release (C) release releas(D) > > } etisalat 12:19 PM Dr Henna 30810 ii) The two variables a and b have initial values of 1 and 2, respectively. The following code is for Linux system: Thread Thread2 mb() b-4c-b mmb(); What possible errors are avoided by the use of the memory barriers? (2Marks) @7 28% etisalat 12:19 PM Dr Henna 30810 Questions cover CLO6: L5 Question 2 5Marks i) Consider a fixed partitioning scheme with equal-size partitions of 2^16 bytes and a total main memory size of 2^24 bytes. A process table is maintained that includes a pointer to a partition for each resident process. How many bits are required for the pointer? (1 Marks) @7 28% etisalat Dr Henna 12:19 PM 30810 prywer van vi u avganvin un va a. 0,228 b. 2,648 c. 3,776 d. 1,98 (0.5*4=2Marks) iii) Consider a dynamic partitioning scheme. Show that, on average, the memory contains half as many holes as segments. (2Marks) 28%
Expert Answer:
Answer rating: 100% (QA)
Answers 1 Part i a When the resources C and F are locked by process P2 and waiting for D to complete the process The process PO locked resources A and ... View the full answer
Related Book For
Operating Systems Internals and Design Principles
ISBN: 978-0133805918
8th edition
Authors: William Stallings
Posted Date:
Students also viewed these operating system questions
-
In the code below, three processes are competing for six resources labeled A to F. a. Using a resource allocation graph, show the possibility of a deadlock in this implementation. b. Modify the order...
-
The two variables a and b have initial values of 1 and 2, respectively. The following code is for a Linux system: What possible errors are avoided by the use of the memory barriers? Thread 1 Thread 2...
-
Two variables x and y have a positive association if large values of .r am associated with large values of y. Write an equivalent definition that describes what small values of x are associated with....
-
The current quoted price of a 13% coupon bond is $110. It pays coupon semi-annually. The next coupon will be paid in 6-days (total number of days in this semi-annual period is 181) and the futures...
-
Spencer Company earned a 16 percent return on its total assets. Current liabilities are 10 percent of total assets. Long-term bonds carrying an 11 percent coupon rate are equal to 30 percent of total...
-
Use the half-reaction method to balance the equation Ca(s) + Cl2(g) CaCl2(s).
-
What pleading is used to commence a lawsuit?
-
Albert Company has an investment in the voting shares of Prince Ltd. On December 31, Year 5, Prince reported a net income of $860,000 and declared dividends of $200,000. During Year 5, Albert had...
-
OMG Inc. has 5 million shares of common stock outstanding, 4 million shares of preferred stock outstanding, and 6 , 0 0 0 bonds. Suppose the common shares are selling for $ 2 0 per share, the...
-
a. Do you agree with the controllers recommendation? Why or why not? b. Formulate an LP model for this problem. c. Create a spreadsheet model for this problem and solve it using Solver. d. What is...
-
Obtain the most recent financial statements for BBD. Find the consolidated cash flow statement on page 147. Also, find Note 16 on page 181.+ REQUIRED:+ + 1. Using the consolidated statement of cash...
-
Collaboration in a CPFR sense requires much effort from all parties concerned. After your exploration of West Marine, what are some of the hidden problems that come to light after a firm tries to...
-
How loud is too loud? Loudness can definitely be subjective to the listener, but there are also quantifiable numbers to reference loudness. There are decibel levels that have been proven to cause...
-
Jeremy (unmarried) earned $100,500 in salary and $6,050 in interest income during the year. Jeremy's employer withheld $10,000 of federal income taxes from Jeremy's paychecks during the year. Jeremy...
-
Suppose 215 people suffering from tigeritis were administered medication A in an RCT and 215 people suffering from tigeritis were administered medication B. Each medication causes a modest decrease...
-
Cull Corporation uses a job-order costing system with a single plantwide predetermined overhead rate based on machine-hours. The company based its predetermined overhead rate for the current year on...
-
Bobby is engaged in the business of buying and selling of goods. He is not a VAT-registered taxpayer. His gross receipts in his first year of operation amount to P520,000. Exempt a. What is the...
-
We all experience emotions, but some people disguise their true feelings better than others. Do you think this is a helpful or harmful thing to do? Under what conditions do you think it would be most...
-
It should be possible to implement general semaphores using binary semaphores. We can use the operations semWaitB and semSignalB and two binary semaphores, delay and mutex. Consider the following:...
-
Let buddyk(x) = address of the buddy of the block of size 2k whose address is x. Write a general expression for buddyk(x).
-
Consider a sharable resource with the following characteristics: (1) As long as there are fewer than three processes using the resource, new processes can start using it right away. (2) Once there...
-
Steam flows steadily and isentropically through a nozzle. At an upstream section where the speed is negligible, the temperature and pressure are \(450^{\circ} \mathrm{C}\) and \(6 \mathrm{MPa}\)...
-
Space debris impact is a real concern for spacecraft. If a piece of space debris were to create a hole of \(0.001 \mathrm{in} .^{2}\) area in the hull of the International Space Station (ISS), at...
-
Oxygen discharges from a tank through a convergent nozzle. The temperature and velocity in the jet are \(-20^{\circ} \mathrm{C}\) and \(270 \mathrm{~m} / \mathrm{s}\), respectively. What is the...
Study smarter with the SolutionInn App