Question Description
1. Consider the following resource-allocation policy. Requests for and releases of resources are allowed at any time. If a request for resources cannot be satisfied because the resources are not available, then we check any processes that are blocked waiting for resources. If a blocked process has the desired resources, then these resources are taken away from it and are given to the requesting process. The vector of resources for which the blocked process is waiting is increased to include the resources that were taken away.
For example, consider a system with three resource types and the vector Available initialized to (4,2,2). If process Po asks for (2,2,1), it gets them. If P1 asks for (1,0,1), it gets them. Then, if Po asks for (0,0,1), it is blocked (resource not available). If P2 now asks for (2,0,0), it gets the available one (1,0,0) and one that was allocated to Po (since Po is blocked). Po’s Allocation vector goes down to (1,2,1), and its Need vector goes up to (1,0,1).
a. Can deadlock occur? If you answer “yes,” give an example. If you answer “no,” specify which necessary condition cannot occur.
b. Can indefinite blocking occur? Explain your answer.
2. Consider the following snapshot of a system: Allocation Max Available —-
Answer the following questions using the banker’s algorithm:
a)What is the content of the matrix Need?
b)Is the system in a safe state?
c)If a request from process P1 arrives for (0,4,2,0), can the request be granted immediately?
- Consider a paging system with the page table stored in memory.
(a) If a memory reference takes 200 nanoseconds, how long does a paged memory reference take?
(b) If we add associative registers, and 75% of all page-table references are found in the associative registers, what is the effective memory reference time? (Assume that finding a page-table entry in the associative registers takes zero time, if the entry is there.)
- Consider the following segment table:
What are the physical addressed for the following logical addresses?
(a) 0,430 (b) 1,10 (c) 2,500 (d) 3,400 (e) 4,112