![]() ![]() At any instant of time, there is a current state consisting of existing resource vector E,available resource vector A, current allocation matrix C, and request matrix R.Question-2 Explain safe and unsafe states with example. To avoid the deadlock, B should be suspended until A has requested and released the plotter.If the grant is made, the system will enter an unsafe region and eventually deadlock.The system must decide whether to grant it or not.The important thing to see here is at point t process B is requesting a resource.At point t the only safe thing to do is run process A until it gets to I4.The entire box is unsafe and must not be entered.At this point process A is requesting the plotter and process B is requesting the printer, and both are already assigned.If the system ever enters the box bounded by I1 and I2 on the sides and I5 and I6 top and bottom, it will eventually deadlock when it gets to the intersection of I2 and I6.Similarly, the region shaded the other way represents both processes having the plotter, and is equally impossible.The mutual exclusion rule makes it impossible to enter this region. The region with lines slanting from southwest to northeast represents both processes having the printer. The regions that are shaded are especially interesting.When process B reaches point t, it requests the plotter.When process A crosses the I1 line on the path from r to s, it requests and is granted the printer.At point q the trajectory becomes vertical, indicating that the scheduler has chosen to run process B.If the scheduler chooses to run process A first, we get to the point q, in which process A has executed some number of instructions, but process B has executed none.Initially, the state is at p, with neither process having executed any instructions.Every point in the diagram represents a joint state of the two processes.Process B needs the plotter from I5 to I7 and the printer from I6 to I8.The printer and plotter are released at I3 and I4, respectively.At I1 process A requests a printer at I2 it needs a plotter. ![]() The vertical axis represents the number of instructions executed by process B.The horizontal axis represents the number of instructions executed by process A.Consider a model for dealing with two processes and two resources, for example, a printer and a plotter.Question-1 How Resource Trajectories can be helpful in avoiding the deadlock?įollowing example explains how Resource Trajectories can be helpful in avoiding the deadlock. (2) Explain safe and unsafe states with example.(1) How Resource Trajectories can be helpful in avoiding the deadlock?.Lists of Long Descriptive type Questions that may be asked in Written Exams. Here in this section of Operating System Long Questions and Answers,We have listed out some of the important Long Questions with Answers on Deadlock Avoidance – Resource Trajectories which will help students to answer it correctly in their University Written Exam. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |