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

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
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. One strategy for dealing with starvation would be to adopt a policy where resources are assigned only to the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/02/2011 for the course ECONOMY 111 taught by Professor Sm during the Spring '11 term at Hanoi University of Technology.

Page1 / 5

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online