Hung_Nguyen_HA8

docx

School

George Mason University *

*We aren’t endorsed by this school

Course

342

Subject

Information Systems

Date

Feb 20, 2024

Type

docx

Pages

4

Uploaded by hungnguyen090600

Report
IT 342 HW 8 (100 pts) 1. (10) Why is Prevention not a practical solution to deadlocks? The reason why prevention is not a practical solution to deadlocks is because it cannot handle requests from more than one process at a time, so mutual exclusion cannot be eliminated. Moreover, a process cannot hold a resource while requestion another which lead to starvation and low resource utilization. Also, all resources can only be taken either one at a time or all at once, and this will waste time, and it must restart the process that had the resource preempted. Lastly, it only allows resources to be requested in an order that would preclude a cycle from being formed. This will lead to difficult to agree to order and follow the order. 2. (25) Draw two Resource Allocation Graphs. One depicting three process in deadlock. One depicting at least four processes with no deadlock.
3. (25) 200 memory units are available to the Operating System. Process A is using 50 units and can claim 100. Process B is using 10 units and can claim 30 units. Process C is using 20 units and can claim 60. Process D is using 40 units and can claim 80. Process A requests an additional 30 units. Can the OS grant the request? Show you work. Yes, the OS can grant the request Explanation: 200 memory units available to the OS Process A is using 50, process B is using 10, process C is using 20, and process D is using 40 o 50 + 10 + 20 + 40 = 120 resources As a result, 120 memory units are already allocated to the processes, and the remaining units are 80 (200-120) memory units We cannot satisfy A’s claim because it requires 100 memory units
Allocate memory units to process D, it requires 80 memory units and available 80, so process D completes and releases the remaining resources also Therefore, total available resources are 80+40 = 120 Next, allocate memory units to process B, and process B completes its execution. Now, the total available resources are 120 + 10 = 130 Now process C, therefore total available resources are 130 + 20 = 150 Now process A requires 100, and an additional of 30 units which makes it 130 (100 +30), and we have 150 units available. As a result, OS can grant the request The order of executions can be D-C-B-A, C-B-D-A, C-D-B-A, B-D- C-A, B-C-D-A, D-B-C-A, and so on 4. (10) What is the most common method of handling deadlocks in modern operating systems? There are different methods of handling deadlocks such as deadlock prevention, deadlock avoidance, and deadlock detection. However, the most common method of handling deadlocks in modern operating system is deadlock avoidance. The reason is because whenever a process requests a resource, the OS checks the system state and only grants the request if it leaves the system in a ‘safe’ state. Moreover, safe state is one where deadlock cannot occur in the future. 5. (30) Looking at the methods we discussed in synchronization and deadlocks for dealing with contention which ones are best positioned for use in: 1. Standard Desktop Do nothing, the user will detect and take action accordingly. 2. Standard Laptop Do nothing, the user will detect and take action accordingly. 3. Web Server environment Do nothing because one can just detect it. There won’t be any real damage because of enough computation power to periodically check. 4. Main frame environment
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Do nothing because one can just avoid it. The reason is because of enough computation power to periodically check. 5. Real Time environment Prevention can be done so that it will never occur again in the system, as the systems are very small. 6. Mission Critical environment Prevention can be done so that it will never occur again in the system, as there isn’t enough time to do extra calculations. 7. Stand Alone system Prevention can be done, as there is nothing to hold on, as this is easy in stand-alone system