ECEC-353 Chap 7

# ECEC-353 Chap 7 - 7.1 Two cars crossing a single-lane...

• Notes
• 5

This preview shows page 1 - 2 out of 5 pages.

7.1 Two cars crossing a single-lane bridge from opposite directions. A person going down a ladder while another person is climbing up the ladder. Two trains traveling toward each other on the same track. 7.2 An unsafe state may not necessarily lead to deadlock, it just means that we cannot guarantee that deadlock will not occur. Thus, it is possible that a system in an unsafe state may still allow all processes to complete without deadlock occurring. Consider the situation where a system has 12 resources allocated among processes P 0 , P 1 , and P 2 . The resources are allocated according to the following policy: Max Current Need P0 10 5 5 P1 4 2 2 P2 9 3 6 Currently there are two resources available. This system is in an unsafe state as process P 1 could complete, thereby freeing a total of four resources. But we cannot guarantee that processes P 0 and P 2 can complete. However, it is possible that a process may release resources before requesting any further. For example, process P 2 could release a resource, thereby increasing the total number of resources to five. This allows process P 0 to complete, which would free a total of nine resources, thereby allowing process P 2 to complete as well. 7.3 This is probably not a good solution because it yields too large a scope. It is better to define a locking policy with as narrow a scope as possible. 7.4 As can be seen, the nested outer loops—both of which loop through n times—provide the n 2 performance. Within these outer loops are two sequential inner loops which loop m times. The big-oh of this algorithm is therefore O ( m × n 2 ). 7.5 An argument for installing deadlock avoidance in the system is that we could ensure deadlock would never occur. In addition, despite the increase in turnaround time, all 5,000 jobs could still run. An argument against installing deadlock avoidance software is that deadlocks occur infrequently and they cost little when they do occur. 7.6 Starvation is a difficult topic to define as it may mean different things for different systems. For the purposes of this question, we will define starvation as the situation whereby a process must wait beyond a reasonable period of time—perhaps indefinitely—before receiving a requested resource. One way of detecting starvation would be to first identify a period of time— T —that is considered unreasonable. When a process requests a resource, a timer is started. If the elapsed time exceeds T, then the process is considered to be starved.

Subscribe to view the full document.

• Spring '11
• SM

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern