Question 46
With single resource, deadlock occurs
Step-by-Step Solution
Detailed Explanation:
For a single resource instance, circular wait cannot occur when processes hold and wait for single resources. Thus, none of these causes deadlock.
With single resource, deadlock occurs
Detailed Explanation:
For a single resource instance, circular wait cannot occur when processes hold and wait for single resources. Thus, none of these causes deadlock.
A system has 3 processes sharing 4 resources. If each process needs a maximum of 2 units, then
Detailed Explanation:
Total resources needed for deadlock-free operation = ∑(Max_i - 1) + 1 = 3*(2 - 1) + 1 = 4.
Since 4 resources are available, deadlock can never occur.
Determine the number of page faults when references to pages occur in the following order: 1, 2, 4, 5, 2, 1, 2, 4. Assume that the main memory can accommodate 3 pages and the main memory already has the pages 1 and 2, with page one having brought earlier than page 2. (LRU page replacement algorithm is used)
Detailed Explanation:
Initial memory state: [1, 2] (1 brought earlier).
Ref 1: Hit. Ref 2: Hit.
Ref 4: Memory has space -> [1, 2, 4] (Fault 1).
Ref 5: LRU page is 1 -> Replaced by 5 -> [2, 4, 5] (Fault 2).
Ref 2: Hit -> [4, 5, 2].
Ref 1: LRU page is 4 -> Replaced by 1 -> [5, 2, 1] (Fault 3).
Ref 2: Hit -> [5, 1, 2].
Ref 4: LRU page is 5 -> Replaced by 4 -> [1, 2, 4] (Fault 4).
Total page faults = 4.
Working Set (t,k) at an instant of time t is
Detailed Explanation:
In virtual memory, Working Set W(t, $\Delta ) represents$ the set of distinct pages referenced by the process during the last $\Delta time$ units.
A CPU generates 32-bit virtual addresses. The page size is 4 KB. The processor has a translation look-aside buffer (TLB) which can hold a total of 128 page table entries and is 4-way set associative. The minimum size of the TLB tag is:
Detailed Explanation:
$Page size = 4 KB = 2^12 Bytes => Offset = 12 bits. Virtual Page Number (VPN) = 32 - 12 = 20 bits.$
$TLB Sets = 128 / 4 = 32 = 2^5 => TLB Index = 5 bits.$
TLB Tag size = VPN - TLB Index = 20 - 5 = 15 bits.