Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A and B are two binary semaphores initialized to 1 and 0 , respectively. $X$ is a shared variable initialized to 0 . Each line in the pseudocode is executed atomically. Pseudocode of P1, P2, and P3
Wait(A);
Print(*);
X = X+1;
If (X == 2)
{
Print($);
Signal(B);
}
Signal(A);
Wait(B);
Print(#);
Signal(B);
Assume that any of the three processes can start to execute first and context switching can happen between these processes at any arbitrary time and in any arbitrary order. Which of the following patterns is/are possible to be generated as an outcome of the execution of these three processes?
To keep track of free blocks in a file system, one of the two approaches is generally used - using bitmaps (bit vectors) or using linked lists. Consider that the linked list approach is used to keep track of free blocks in a file system. Assume that the disk size is 16 GB , block size is 2 KB , and block numbers used are 32-bit long. A single pointer of size 4 bytes is used in each block of the list to point to the next block of the list. The number of blocks required to hold the free disk block numbers is $\_\_\_\_$ (answer in integer)
Note: $1 \mathrm{~K}=2^{10}$ and $1 \mathrm{G}=2^{30}$
A system has a Translation Lookaside Buffer (TLB) that has a reach of 1 MB . TLB reach is defined as the total amount of physical memory that can be accessed through the TLB entries. The paging system uses pages of size 4 KB . The virtual address space is 64 GB and physical address space is 1 GB . If each TLB entry stores a 4-bit process id, page number, frame number, and a 2-bit control field, then the size of the TLB (in bytes) is $\_\_\_\_$ . (answer in integer)
Note: $1 \mathrm{~K}=2^{10}, 1 \mathrm{M}=2^{20}, 1 \mathrm{G}=2^{30}$
Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are 8 holes in the memory of sizes $20 \mathrm{~KB}, 4 \mathrm{~KB}$, $25 \mathrm{~KB}, 18 \mathrm{~KB}, 7 \mathrm{~KB}, 9 \mathrm{~KB}, 15 \mathrm{~KB}$, and 12 KB . Assume that no two holes are adjacent. Two processes P1 of size 16 KB and P2 of size 9 KB arrive in that order, and they are allocated memory using the best-fit technique. After allocating space to P1 and P2, the number of holes of size less than 8 KB is $\_\_\_\_$ . (answer in integer)
Note: $1 \mathrm{~K}=2^{10}$
GATE CSE Papers
All year-wise previous year question papers