-
583.
-
584.
-
585.
-
586.
-
587.
Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the processes P and Q is shown below.
Synchronization statements can be inserted only at points W, X, Y, and Z.
[1] Which of the following will always lead to an output staring with ‘001100110011’?
[2 marks]
(A) P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S and T initially 1
(B) P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S initially 1, and T initially 0
(C) P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1
(D) P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S initially 1, and T initially 0[2] Which of the following will ensure that the output string never contains a substring of the form 01n0 or 10n1 where n is odd? [2 marks]
(A) P(S) at W, V(S) at X, P(T) at Y, V(T) at Z, S and T initially 1
(B) P(S) at W, V(T) at X, P(T) at Y, V(S) at Z, S and T initially 1
(C) P(S) at W, V(S) at X, P(S) at Y, V(S) at Z, S initially 1
(D) V(S) at W, V(T) at X, P(S) at Y, P(T) at Z, S and T initially 1last reply by CpjJwWHV • 14 years ago • asked in Computer Science And Engineering, 2003
View Comments [2 Reply]
-
588.
A processor uses 2-level page tables for virtual to physical address translation. Page
tables for both levels are stored in the main memory. Virtual and physical addresses are both 32 bits wide. The memory is byte addressable. For virtual to physical address translation, the 10 most significant bits of the virtual address are used as index into the first level page table while the next 10 bits are used as index into the second level page table. The 12 least significant bits of the virtual address are used as offset within the page. Assume that the page table entries in both levels of page tables are 4 bytes wide.
Further, the processor has a translation look-aside buffer (TLB), with a hit rate of 96%. The TLB caches recently used virtual page numbers and the corresponding physical page numbers. The processor also has a physically addressed cache with a hit rate of 90%. Main memory access time is 10 ns, cache access time is 1 ns, and TLB access time is also 1 ns.[1] Assuming that no page faults occur, the average time taken to access a virtual address is approximately (to the nearest 0.5 ns) [2 marks]
(A) 1.5 ns
(B) 2 ns
(C) 3 ns
(D) 4 ns[2] Suppose a process has only the following pages in its virtual address space: two contiguous code pages starting at virtual address 0×00000000, two contiguous data pages starting at virtual address 0×00400000, and a stack page starting at virtual address 0×FFFFF000. The amount of memory required for storing the page tables of this process is [2 marks]
(A) 8 KB
(B) 12 KB
(C) 16 KB
(D) 20 KBasked in Computer Science And Engineering, 2003
View Comments [0 Reply]