Thursday, June 21, 2012

cs604 GDB solution Operating System fall june 2012


Suppose a computer lab contains two printers, three tape drives, and four terabyte crystal ROM writers. Assume process 2 is currently using a printer and two crystal ROM writers, process 1 is using a tape drive, and process 3 is using two crystal ROM writers, a tape drive, and a printer.
Suppose now that process 2 requires a tape drive, process 1 requires a printer, and process 3 requires one more crystal ROM writer. Does there exist any safe sequence or not? Give reason/justification to support your answer.”
If you will give invalid reason/justification then you will get zero marks with no leniency. Give reason precisely and briefly to support your comments. The more you will be precise and brief in your comments the more you will get the marks. 

Solution:

Yes there exists safe state.
When all processes take their resources then only one tape drive remained free. Process 2 require 1 tape drive so process 2 gets it. After using it and P2 free all its resources and now P1 Get Printer Resource which is freed by P2. Now Process 3 Used 2 ROM, 2 ROM are already freed by P2. SO we can easily say this that system is in safe state, no deadlock. 

No comments:

Post a Comment