Question

In: Computer Science

Is the following system in a safe state? Process Allocation Max Available A B C A...

Is the following system in a safe state?

Process Allocation Max Available
A B C A B C A B C

P0 1 1 0 3 2 0 3 2 2
P1 0 0 1 3 2 2
P2 2 1 0 2 2 1

how to answer this kind of question.

Solutions

Expert Solution

Safe state implies that the processes can be allocated without encountering deadlock. To check whether the system is in a safe state we can use Bankers Algorithm.

Bankers Algorithm :

Step1: Calculate the need of all the processes.

Step2: Select a process and check if its need of each resource available resources, if yes then enter this process into the safe sequence otherwise go to step 4.

Step3: Update the available resources by adding the available resources with the allocated resources of that process and go to step2

available = available + allocated

Step4: Choose another process and go to step2

If all the processes come in the safe sequence then system is in safe state otherwise it's unsafe.

Hope this helps!!


Related Solutions

Consider the following snapshot of a system: Allocation Max Available A B C D A B...
Consider the following snapshot of a system: Allocation Max Available A B C D A B C D A B C D P0 0 0 1 2 0 0 1 2 1 5 2 0 P1 1 0 0 0 1 7 5 0 P2 1 3 5 4 2 3 5 6 P3 0 6 3 2 0 6 5 2 P4 0 0 1 4 0 6 5 6 Answer the following questions using the banker’s algorithm: a....
Consider the following snapshot of a system: Allocation                   Max                 Availa
Consider the following snapshot of a system: Allocation                   Max                 Available A B C D              A B C D                    A B C D P0                    0 0 1 2                0 0 1 2                      1 5 2 0 P1                    1 0 0 0                1 7 5 0 P2                    1 3 5 4                2 3 5 6 P3                    0 6 3 2                0 6 5 2 P4                   0 0 1...
The command C = max(A,B) compares corresponding values in the A and B matrices assuming they...
The command C = max(A,B) compares corresponding values in the A and B matrices assuming they are the same size. The problem is that MATLAB’s native version does not tell you from which matrix it found the largest value. Write a new function (in MATLAB) [C,from_which] = max_new(A,B) that also output a matrix, the same size as the inputs, with either 1’s or 2’s depending on from which matrix the larger value was found. Include a live script that tests...
Zorzi Corporation uses a process costing system. The following information is available for one department in...
Zorzi Corporation uses a process costing system. The following information is available for one department in December.                                                                                           Percent Completed                                                             Units                Materials          Conversion Work in Process December 1                            30,000                        65%                        30% Work in Process December 31                         15,000                       80%                         40% The Department started 175,000 units into production during the month and transferred 190,000 completed units To the next department. Required: Compute the equivalent units of production for December assuming that the company uses the weighted-average...
The following table gives the available projects (in $millions) for a firm. A B C D...
The following table gives the available projects (in $millions) for a firm. A B C D E F G 90 20 60 50 150 40 20 Initial investment 140 70 65 −10 30 32 10 NPV If the firm has a limit of $210 million to invest, what is the maximum NPV the company can obtain? Explain how you decided to prioritize the projects (i.e. use Profitability Index or just reference NPV)
A system has five workstations (A, B, C, D, and E) connected in sequence, with process...
A system has five workstations (A, B, C, D, and E) connected in sequence, with process times of 5, 10, 4, 9, and 8 seconds per unit each, respectively.  Each workstation contains a single machine. 1. which workstation is the bottleneck of the system:           a.   Workstation A           b.   Workstation B           c.   Workstation C           d.   Workstation D 2. the system process time of this process is:           a.   5.1 seconds                                                                                        b.   10 seconds           c.   15 seconds           d.   36 seconds 3. assume Workstation B now contains two machines, each of which can...
Give a brief definition for each of the following A. Process B. Process switch C. GUI...
Give a brief definition for each of the following A. Process B. Process switch C. GUI D. Window manager E. Interrupt handler F. Ready process G. Waiting process H. shell Summarize the booting procedure. What are the 5 components of an OS’s kernel? Summarize the role for each of them What does CPU do when it receives an interrupt? What information is contained in the state of a process? If each time slice in a time sharing system is 40...
The Poolside Company uses a FIFO process costing system. The following data are available: Beginning inventory...
The Poolside Company uses a FIFO process costing system. The following data are available: Beginning inventory 1,000 units (100% complete as to materials and 50% complete as to labor and overhead); Units started in production 19,000; Units finished during the period 16,000; Units in process at the end of the period (100% complete as to materials and 25% complete as to labor and overhead) 4,000; Costs in beginning inventory were materials of $1,500 and Labor and overhead costs $1,000; Cost...
Giant Company has three products, A, B, and C. The following information is available: Product A...
Giant Company has three products, A, B, and C. The following information is available: Product A Product B Product C Sales $70,000 $97,000 $23,000 Variable costs 37,000 51,000 15,000 Contribution margin 33,000 46,000 8,000 Fixed costs: Order and delivery costs 10,000 20,000 2,000 Allocated corporate costs 7,000 12,000 9,400 Operating income $16,000 $14,000 $ (3,400) Delivery and ordering costs are avoidable costs. a. Do you recommend discontinuing the Product C line? Why or why not? b. What additional factors should...
9.      Chapter 13 bankruptcy a. is available to corporations. b. is available to partnerships. c. permit...
9.      Chapter 13 bankruptcy a. is available to corporations. b. is available to partnerships. c. permit a business to reorganize while paying its debts. d. is available to individuals. e. a and c. 10.    A secured creditor is one who a. does not back a loan with the debtor’s property. b. has the ability to take the debtor’s property to satisfy the debt. c. does not have the ability to take the debtor’s property to satisfy the debt. d. uses...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT