Operating System GATE PYQ Solutions

Q1➡ | GATE 2021 Set-1
Consider a linear list based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name along with the file metadata, such as the list of pointers to the data blocks.Consider a given directory foo.
Which of the following operations will necessarily require a full scan of foo for successful completion?
i ➥ Opening of an existing file in foo
ii ➥ Renaming of an existing file in foo
iii ➥ Deletion of an existing file from foo
iv ➥ Creation of a new file in foo

Show Answer With Best Explanation

Answer: II, IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeFile System Help-Line

Q2➡ | GATE 2021 Set-1
Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/linux operating system?
i ➥ malloc
ii ➥ strlen
iii ➥ exit
iv ➥ sleep

Show Answer With Best Explanation

Answer: III, IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeSystem Calls Help-Line

Q3➡ | GATE 2021 Set-1
In the context of operating systems, which of the following statements is/are correct with respect to paging?
i ➥ Multilevel paging is necessary to support pages of different sizes.
ii ➥ Paging helps solve the issue of external fragmentation.
iii ➥ Page size has no impact on internal fragmentation.
iv ➥ Paging incurs memory overheads.

Show Answer With Best Explanation

Answer: II, IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeMemory Management Help-Line

Q4➡ | GATE 2021 Set-1
Three processes arrive at time zero with CPU bursts of 16, 20 and 10 milliseconds. If the scheduler has prior knowledge about the length of the CPU bursts, the minimum achievable average waiting time for these three processes in a non-preemptive scheduler (rounded to nearest integer) is _______ milliseconds.

Show Answer With Best Explanation

Answer: 12
Explanation: Upload Soon

More DiscussionExplanation On YouTubeCPU Scheduling Help-Line

Q5➡ | GATE 2021 Set-1
There are 6 jobs with distinct difficulty levels, and 3 computers with distinct processing speeds. Each job is assigned to a computer such that:
• The fastest computer gets the toughest job and the slowest computer gets the easiest job.
• Every computer gets at least one job.
The number of ways in which this can be done is ____

Show Answer With Best Explanation

Answer: 65
Explanation: Upload Soon

More DiscussionExplanation On YouTube CPU Scheduling Help-Line

Q6➡ | GATE 2021 Set-1
Consider the following pseudocode, where S is a semaphore initialized to 5 in line#2 and counter is a shared variable initialized to 0 in line#1. Assume that the increment operation in line#7 is not atomic.

If five threads execute the function parop concurrently, which of the following program behaviour(s) is/are possible?
i ➥ The value of counter is 0 after all the threads successfully complete the execution of parop.
ii ➥ The value of counter is 5 after all the threads successfully complete the execution of parop.
iii ➥ There is a deadlock involving all the threads.
iv ➥ The value of counter is 1 after all the threads successfully complete the execution of parop.

Show Answer With Best Explanation

Answer: II, III, IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeSemaphore Help-Line

Q7➡ | GATE 2021 Set-2
Which of the following statement(s) is/are correct in the context of CPU scheduling?
i ➥ Round-robin policy can be used even when the CPU time required by each of the processes is not known apriori.
ii ➥ Turnaround time includes waiting time
iii ➥ Implementing preemptive scheduling needed hardware support.
iv ➥ The goal is to only maximize CPU utilization and minimize throughput.

Show Answer With Best Explanation

Answer: I, II, III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeCPU SchedulingHelp-Line

Q8➡ | GATE 2021 Set-2
Consider a computer system with multiple shared resource types, with one instance per resource type. Each instance can be owned by only one process at a time. Owning and freeing of resources are done by holding a global lock (L). The following scheme is used to own a resource instance:
i ➥ The scheme may lead to starvation.
ii ➥ The scheme ensures that deadlocks will not occur.
iii ➥ The scheme may lead to live-lock.
iv ➥ The scheme violates the mutual exclusive property.

Show Answer With Best Explanation

Answer: I, II, III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess SynchronizationHelp-Line

Q9➡ | GATE 2021 Set-2
i ➥ Both P1 and P2 will print the value of x as2.
ii ➥ At least one of P1 and P2 will print the value of x as 4.
iii ➥ Both T1 and t2, in both the processes, will print the value of y as 1.
iv ➥ At least one of the threads will print the value of y as 2.

Show Answer With Best Explanation

Answer: I, III
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process SynchronizationHelp-Line

Q10➡ | GATE 2021 Set-2
Consider a three-level page table to translate a 39-bit virtual address to a physical address as shown below:

The page size is 4KB (1KB = 210bytes) and page table entry size at every level is 8 bytes. A process P is currently using 2GB (1GB = 230bytes) virtual memory which is mapped to 2GB of physical memory. The minimum amount of memory required for the page table of P across all levels is_______ KB.

Show Answer With Best Explanation

Answer: 4108
Explanation: Upload Soon

More DiscussionExplanation On YouTubePaging Help-Line

Q11➡ | GATE 2020
Consider the following statements about process state transitions for a system using preemptive scheduling.
I. A running process can move to ready state.
II. A ready process can move to running state.
III. A blocked process can move to running state.
IV. A blocked process can move to ready state.
Which of the above statements are TRUE?
i ➥ I, II and III only
ii ➥ II and III only
iii ➥ I, II and IV only
iv ➥ I, II, III and IV

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess Scheduling Help-Line

Q12➡ | GATE 2020
Consider allocation of memory to a new process. Assume that none of the existing holes in the memory will exactly fit the process’s memory requirement. Hence, a new hole of smaller size will be created if allocation is made in any of the existing holes.
Which one of the following statements is TRUE?
i ➥ The hole created by next fit is never larger than the hole created by best fit.
ii ➥ The hole created by worst fit is always larger than the hole created by first fit.
iii ➥ The hole created by first fit is always larger than the hole created by next fit.
iv ➥ The hole created by best fit is never larger than the hole created by first fit.

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTube Memory Management Help-Line

Q13➡ | GATE 2020
Consider the following five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given time.
(P, 155), (Q, 85), (R, 110), (S, 30), (T, 115)
Assume the head is positioned at cylinder 100. The scheduler follows Shortest Seek Time First scheduling to service the requests.
Which one of the following statements is FALSE?
i ➥ Q is serviced after S, but before T.
ii ➥ R is serviced before P.
iii ➥ T is serviced before P.
iv ➥ The head reverses its direction of movement between servicing of Q and P.

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDisk Scheduling Help-Line

Q14➡ | GATE 2020
Each of a set of n processes executes the following code using two semaphores a and b initialized to 1 and 0, respectively. Assume that count is a shared variable initialized to 0 and not used in CODE SECTION P.

What does the code achieve?
i ➥ It ensures that no process executes CODE SECTION Q before every process has finished CODE SECTION P.
ii ➥ It ensures that at most two processes are in CODE SECTION Q at any time.
iii ➥ It ensures that at most n-1 processes are in CODE SECTION P at any time.
iv ➥ It ensures that all processes execute CODE SECTION P mutually exclusively.

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess SynchronizationHelp-Line

Q15➡ | GATE 2020
Consider the following set of processes, assumed to have arrived at time 0. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the order P1,P2,P3,P4.

If the time quantum for RR is 4 ms, then the absolute value of the difference between the average turnaround times (in ms) of SJF and RR (round off to 2 decimal places) is ________.

Show Answer With Best Explanation

Answer: 5.25
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess Scheduling Help-Line

Q16➡ | GATE 2020
Consider a paging system that uses a 1-level page table residing in main memory and a TLB for address translation. Each main memory access takes 100 ns and TLB lookup takes 20 ns. Each page transfer to/from the disk takes 5000 ns. Assume that the TLB hit ratio is 95%, page fault rate is 10%. Assume that for 20% of the total page faults, a dirty page has to be written back to disk before the required page is read in from disk. TLB update time is negligible. The average memory access time in ns (round off to 1 decimal places) is _______.

Show Answer With Best Explanation

Answer: 154.5
Explanation: Upload Soon

More DiscussionExplanation On YouTubeMemory ManagementHelp-Line

Q17➡ | GATE 2019
The following C program is executed on a Unix/Linux system:

The total number of child processes created is _____.

Show Answer With Best Explanation

Answer: 31
Explanation: Upload Soon

More DiscussionExplanation On YouTubeSystem Calls Help-Line

Q18➡ | GATE 2019
Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8 kB and the word size is 4 bytes. The Translation Look-aside Buffer (TLB) in the address translation path has 128 valid entries. At most how many distinct virtual addresses can be translated without any TLB miss?
i ➥ 256×210
ii ➥ 8×220
iii ➥ 4×220
iv ➥ 16×210

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeMemory ManagementHelp-Line

Q19➡ | GATE 2019
The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointers. The disk block size is 4 kB, and the disk block address is 32-bits long. The maximum possible file size is (rounded off to 1 decimal place) ________ GB.

Show Answer With Best Explanation

Answer: 4.0
Explanation: Upload Soon

More DiscussionExplanation On YouTubeFile System Help-Line

Q20➡ | GATE 2019
Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below:

These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling algorithm. If the average waiting time of the processes is 1 millisecond, then the value of Z is _______.

Show Answer With Best Explanation

Answer: 2
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess SchedulingHelp-Line

Q21➡ | GATE 2019
Consider the following snapshot of a system running n concurrent processes. Process i is holding Xi instances of a resource R, 1 ≤ i ≤ n. Assume that all instances of R are currently in use. Further, for all i, process i can place a request for at most Yi additional instances of R while holding the Xi instances it already has. Of the n processes, there are exactly two processes p and q such that Yp = Yq = 0. Which one of the following conditions guarantees that no other process apart from p and q can complete execution?
i ➥ Xp + Xq < Min {Yk | 1 ≤ k ≤ n, k ≠ p, k ≠ q}
ii ➥ Min (Xp, Xq) ≤ Max {Yk | 1 ≤ k ≤ n, k ≠ p, k ≠ q}
iii ➥ Min (Xp, Xq) ≥ Min {Yk | 1 ≤ k ≤ n, k ≠ p, k ≠ q}
iv ➥ Xp + Xq < Max {Yk | 1 ≤ k ≤ n, k ≠ p, k ≠ q}

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDeadlock Help-Line

Q22➡ | GATE 2018
Consider a system with 3 processes that share 4 instances of the same resource type. Each process can request a maximum of K instances. Resource instances can be requested and released only one at a time. The largest value of K that will always avoid deadlock is _.

Show Answer With Best Explanation

Answer: 2
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDeadlock Help-Line

Q23➡ | GATE 2018
Consider the following solution to the producer-consumer synchronization problem. The shared buffer size is N. Three semaphores empty, full and mutex are defined with respective initial values of 0, N and 1. Semaphore empty denotes the number of available slots in the buffer, for the consumer to read from. Semaphore full denotes the number of available slots in the buffer, for the producer to write to. The placeholder variables, denoted by P, Q, R and S, in the code below can be assigned either empty or full. The valid semaphore operations are: wait() and signal().

Which one of the following assignments to P, Q, R and S will yield the correct solution?
i ➥ P: full, Q: full, R: empty, S: empty
ii ➥ P: empty, Q: empty, R: full, S: full
iii ➥ P: full, Q: empty, R: empty, S: full
iv ➥ P: empty, Q: full, R: full, S: empty

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess SynchronizationHelp-Line

Q24➡ | GATE 2018
In a system, there are three types of resources: E, F and G. Four processes P0, P1, P2 and P3 execute concurrently. At the outset, the processes have declared their maximum resource requirements using a matrix named Max as given below. For example, Max[P2, F] is the maximum number of instances of F that P2 would require. The number of instances of the resources allocated to the various processes at any given state is given by a matrix named Allocation.
Consider a state of the system with the Allocation matrix as shown below, and in which 3 instances of E and 3 instances of F are the only resources available.

From the perspective of deadlock avoidance, which one of the following is true?
i ➥ The system is in safe state.
ii ➥ The system is not in safe state, but would be safe if one more instance of E were available.
iii ➥ The system is not in safe state, but would be safe if one more instance of F were available.
iv ➥ The system is not in safe state, but would be safe if one more instance of G were available.

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDeadlock Help-Line

Q25➡ | GATE 2018
Consider a storage disk with 4 platters (numbered as 0, 1, 2 and 3), 200 cylinders (numbered as 0, 1, … , 199), and 256 sectors per track (numbered as 0, 1, … 255). The following 6 disk requests of the form [sector number, cylinder number, platter number] are received by the disk controller at the same time:

[120, 72, 2], [180, 134, 1], [60, 20, 0], [212, 86, 3], [56, 116, 2], [118, 16, 1]

Currently head is positioned at sector number 100 of cylinder 80, and is moving towards higher cylinder numbers. The average power dissipation in moving the head over 100 cylinders is 20 milliwatts and for reversing the direction of the head movement once is 15 milliwatts. Power dissipation associated with rotational latency and switching of head between different platters is negligible.

The total power consumption in milliwatts to satisfy all of the above disk requests using the Shortest Seek Time First disk scheduling algorithm is __ .

Show Answer With Best Explanation

Answer: 85
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDisk-SchedulingHelp-Line

Q26➡ | GATE 2017 Set-1
Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) as given below:

If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then the average waiting time across all processes is _________ milliseconds.

Show Answer With Best Explanation

Answer: 3.0
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess Scheduling Help-Line

Q27➡ | GATE 2017 Set-1
A multithreaded program P executes with x number of threads and used y number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock l, then it cannot re-acquire lock l without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of x and the minimum value of y together for which execution of P can result in a deadlock are:
i ➥ x = 2, y = 1
ii ➥ x = 1, y = 1
iii ➥ x = 1, y = 2
iv ➥ x = 2, y = 2

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process SynchronizationHelp-Line

Q28➡ | GATE 2017 Set-1
Recall that Belady’s anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:
S1: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady’s anomaly
S2: LRU page replacement algorithm suffers from Belady’s anomaly

Which of the following is CORRECT?
i ➥ S1 is false, S2 is false
ii ➥ S1 is true, S2 is false
iii ➥ S1 is true, S2 is true
iv ➥ S1 is false, S2 is true

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubePage Replacement AlgorithmHelp-Line

Q29➡ | GATE 2017 Set-2
In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed?
I. Contiguous
II. Linked
III. Indexed
i ➥ II and III only
ii ➥ I and III only
iii ➥ II only
iv ➥ III only

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeFile Allocation MethodsHelp-Line

Q30➡ | GATE 2017 Set-2
Which of the following is/are shared by all the threads in a process?
I. Program counter
II. Stack
III. Address space
IV. Registers
i ➥ IV only
ii ➥ III and IV only
iii ➥ III only
iv ➥ I and II only

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeThreads Help-Line

Q31➡ | GATE 2017 Set-2
A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below:
A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for three processes are shown below: Which of the following best describe current state of the system?
Which of the following best describe current state of the system?
i ➥ Not Safe, Not Deadlocked
ii ➥ Not Safe, Deadlocked
iii ➥ Safe, Not Deadlocked
iv ➥ Safe, Deadlocked

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDeadlock Help-Line

Q32➡ | GATE 2017 Set-2
Consider the set of processes with arrival time (in milliseconds), CPU burst time (in milliseconds), and priority (0 is the highest priority) shown below. None of the processes have I/O burst time.

The average waiting time (in milliseconds) of all the processes using preemptive priority scheduling algorithm is ________.

Show Answer With Best Explanation

Answer: 29
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess Scheduling Help-Line

Q33➡ | GATE 2016 Set-1
Consider an arbitrary set of CPU-bound processes with unequal CPU burst lengths submitted at the same time to a computer system. Which one of the following process scheduling algorithms would minimize the average waiting time in the ready queue?
i ➥ Highest priority first with priority proportional to CPU burst length
ii ➥ Uniform random
iii ➥ Round-robin with time quantum less than the shortest CPU burst
iv ➥ Shortest remaining time first

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process Scheduling Help-Line

Q34➡ | GATE 2016 Set-1
Consider a computer system with 40-bit virtual addressing and page size of sixteen kilobytes. If the computer system has a one-level page table per process and each page table entry requires 48 bits, then the size of the per-process page table is _________megabytes.

Show Answer With Best Explanation

Answer: 384
Explanation: Upload Soon

More DiscussionExplanation On YouTubePaging Help-Line

Q35➡ | GATE 2016 Set-1
Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0 to 199.
The total head movement (in number of cylinders) incurred while servicing these requests is __________.

Show Answer With Best Explanation

Answer: 346
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDisk Scheduling Help-Line

Q36➡ | GATE 2016 Set-1
Consider a computer system with ten physical page frames. The system is provided with an access sequence (a1,a2,…,a20,a1,a2,…,a20), where each ai
is a distinct virtual page number. The difference in the number of page faults between the last-in-first-out page replacement policy and the optimal page replacement policy is ____________.

Show Answer With Best Explanation

Answer: 1
Explanation: Upload Soon

More DiscussionExplanation On YouTubePage Replacement AlgorithmHelp-Line

Q37➡ | GATE 2016 Set-1
Consider the following proposed solution for the critical section problem. There are n processes: P0…P(n-1). In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.
Code for Pi:

Which one of the following is TRUE about the above solution?
i ➥ At most one process can be in the critical section at any time
ii ➥ The bounded wait condition is satisfied
iii ➥ The progress condition is satisfied
iv ➥ It cannot cause a deadlock

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess Scheduling Help-Line

Q38➡ | GATE 2016 Set-2
In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the number of allocated frames increases?
i ➥ FIFO (First In First Out)
ii ➥ MRU (Most Recently Used)
iii ➥ OPT (Optimal Page Replacement)
iv ➥ LRU (Least Recently Used)

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTube Page Replacement Algorithm Help-Line

Q39➡ | GATE 2016 Set-2
Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling algorithm
used is preemptive shortest remaining-time first.
Process Arrival Time Burst Time

The average turn around time of these processes is _________ milliseconds.

Show Answer With Best Explanation

Answer: 8.2 to 8.3
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess Scheduling Help-Line

Q40➡ | GATE 2016 Set-2
Consider the following two-process synchronization solution.

The shared variable turn is initialized to zero. Which one of the following is TRUE?
i ➥ This is a correct two-process synchronization solution.
ii ➥ This solution violates mutual exclusion requirement.
iii ➥ This solution violates progress requirement.
iv ➥ This solution violates bounded wait requirement.

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess SynchronizationHelp-Line

Q41➡ | GATE 2016 Set-2
Consider a non-negative counting semaphore S. The operation P(S) decrements S, and V(S) increments S. During an execution, 20 P(S) operations and 12 V(S) operations are issued in some order. The largest initial value of S for which at least one P(S) operation will remain blocked is _________.

Show Answer With Best Explanation

Answer: 7
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process Synchronization Help-Line

Q42➡ | GATE 2016 Set-2
A file system uses an in-memory cache to cache disk blocks. The miss rate of the cache is shown in the figure. The latency to read a block from the cache is 1 ms and to read a block from the disk is 10 ms. Assume that the cost of checking whether a block exists in the cache is negligible. Available cache sizes are in multiples of 10 MB.

The smallest cache size required to ensure an average read latency of less than 6 ms is ________ MB.

Show Answer With Best Explanation

Answer: 30
Explanation: Upload Soon

More DiscussionExplanation On YouTubeCache Memory Help-Line

Q43➡ | GATE 2015 Set-1
Consider a system with byte-addressable memory, 32-bit logical addresses, 4 kilobyte page size and page table entries of 4 bytes each. The size of the page table in the system in megabytes is___________.

Show Answer With Best Explanation

Answer: 4
Explanation: Upload Soon

More DiscussionExplanation On YouTube Paging Help-Line

Q44➡ | GATE 2015 Set-1
The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.

The number of distinct values that B can possibly take after the execution is

Show Answer With Best Explanation

Answer: 3
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process Synchronization Help-Line

Q45➡ | GATE 2015 Set-1
Consider a uniprocessor system executing three tasks T1, T2 and T3, each of which is composed of an infinite sequence of jobs (or instances) which arrive periodically at intervals of 3, 7 and 20 milliseconds, respectively. The priority of each task is the inverse of its period and the available tasks are scheduled in order of priority, with the highest priority task scheduled first. Each instance of T1, T2 and T3 requires an execution time of 1, 2 and 4 milliseconds, respectively. Given that all tasks initially arrive at the beginning of the 1st millisecond and task preemptions are allowed, the first instance of T3 completes its execution at the end of ___________ milliseconds.

Show Answer With Best Explanation

Answer: 12
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess Scheduling Help-Line

Q46➡ | GATE 2015 Set-1
Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is on track 50. The additional distance that will be traversed by the R/W head when the Shortest Seek Time First (SSTF) algorithm is used compared to the SCAN (Elevator) algorithm (assuming that SCAN algorithm moves towards 100 when it starts execution)
is _________ tracks.

Show Answer With Best Explanation

Answer: 10
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDisk Scheduling Help-Line

Q47➡ | GATE 2015 Set-1
Consider a main memory with five page frames and the following sequence of page references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. Which one of the following is true with respect to page replacement policies First-In-First Out (FIFO) and Least Recently Used (LRU)?
i ➥ Both incur the same number of page faults
ii ➥ FIFO incurs 2 more page faults than LRU
iii ➥ LRU incurs 2 more page faults than FIFO
iv ➥ FIFO incurs 1 more page faults than LRU

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubePage Replacement AlgorithmHelp-Line

Q49➡ | GATE 2015 Set-2
A system has 6 identical resources and N processes competing for them. Each process can request atmost 2 resources. Which one of the following values of N could lead to a deadlock?
i ➥ 1
ii ➥ 2
iii ➥ 3
iv ➥ 6

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDeadlock Help-Line

Q50➡ | GATE 2015 Set-2
Consider six memory partitions of sizes 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and 250 KB, where KB refers to kilobyte. These partitions need to be allotted to four processes of sizes 357 KB, 210KB, 468 KB and 491 KB in that order. If the best fit algorithm is used, which partitions are NOT allotted to any process?
i ➥ 200KBand 300 KB
ii ➥ 200KBand 250 KB
iii ➥ 250KBand 300 KB
iv ➥ 300KBand 400 KB

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTube Memory Managemnt Help-Line

Q51➡ | GATE 2015 Set-2
A computer system implements 8 kilobyte pages and a 32-bit physical address space. Each page table entry contains a valid bit, a dirty bit, three permission bits, and the translation. If the maximum size of the page table of a process is 24 megabytes, the length of the virtual address supported by the system is _______ bits.

Show Answer With Best Explanation

Answer: 36
Explanation: Upload Soon

More DiscussionExplanation On YouTube Virtual Memory Help-Line

Q52➡ | GATE 2015 Set-3
The maximum number of processes that can be in Ready state for a computer system with n CPUs is
i ➥ n
ii ➥ n2
iii ➥ 2n
iv ➥ Independent of n

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process Scheduling Help-Line

Q54➡ | GATE 2015 Set-3
Two processes X and Y need to access a critical section. Consider the following synchronization construct used by both the processes

Here varP and varQ are shared variables and both are initialized to false. Which one of the following statements is true?
i ➥ The proposed solution prevents deadlock but fails to guarantee mutual exclusion
ii ➥ The proposed solution guarantees mutual exclusion but fails to prevent deadlock
iii ➥ The proposed solution guarantees mutual exclusion and prevents deadlock
iv ➥ The proposed solution fails to prevent deadlock and fails to guarantee mutual exclusion

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeTransaction Management Help-Line

Q55➡ | GATE 2015 Set-3
Consider the following policies for preventing deadlock in a system with mutually exclusive resources.
I. Processes should acquire all their resources at the beginning of execution. If any resource is not available, all resources acquired so far are released.
II. The resources are numbered uniquely, and processes are allowed to request for resources only in increasing resource numbers.
III. The resources are numbered uniquely, and processes are allowed to request for resources only in decreasing resource numbers.
IV. The resources are numbered uniquely. A process is allowed to request only for a resource with resource number larger than its currently held resources.
Which of the above policies can be used for preventing deadlock?
i ➥ Any one of I and III but not II or IV
ii ➥ Any one of I, III, and IV but not II
iii ➥ Any one of II and III but not I or IV
iv ➥ Any one of I, II, III, and IV

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTube Deadlock Help-Line

Q57➡ | GATE 2015 Set-3
Consider the following two C code segments. Y and X are one and two dimensional arrays of size n and n × n respectively, where 2 ≤ n ≤ 10. Assume that in both code segments, elements of Y are initialized to 0 and each element X[i][j] of array X is initialized to i + j. Further assume that when stored in main memory all elements of X are in same main memory page frame.


Which of the following statements is/are correct?
S1: Final contents of array Y will be same in both code segments.
S2: Elements of array X accessed inside the for loop shown in code segment 1 are contiguous in main memory.
S3: Elements of array X accessed inside the for loop shown in code segment 2 are contiguous in main memory.
i ➥ Only S2 is correct
ii ➥ Only S3 is correct
iii ➥ Only S1 and S2 are correct
iv ➥ Only S1 and S3 are correct

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeMain Memory Help-Line

Q58➡ | GATE 2015 Set-3
For the processes listed in the following table, which of the following scheduling schemes will give the lowest average turnaround time?
i ➥ First Come First Serve
ii ➥ Non-preemptive Shortest Job First
iii ➥ Shortest Remaining Time
iv ➥ Round Robin with Quantum value two

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeCPU Scheduling Help-Line

Q59➡ | GATE 2014 Set-1
Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is serviced after servicing __ number of requests.

Show Answer With Best Explanation

Answer: 3
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDisk-SchedulingHelp-Line

Q60➡ | GATE 2014 Set-1
Which one of the following is FALSE?
i ➥ User level threads are not scheduled by the kernel.
ii ➥ When a user level thread is blocked, all other threads of its process are blocked.
iii ➥ Context switching between user level threads is faster than context switching between kernel level threads.
iv ➥ Kernel level threads cannot share the code segment.

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTubethreads levelHelp-Line

Q61➡ | GATE 2014 Set-1
An operating system uses the Banker’s algorithm for deadlock avoidance when managing the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.

There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is currently in a safe state. Consider the following independent requests for additional resources in the current state:

REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z
REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z
Which one of the following is TRUE?
i ➥ Only REQ1 can be permitted.
ii ➥ Only REQ2 can be permitted.
iii ➥ Both REQ1 and REQ2 can be permitted.
iv ➥ Neither REQ1 nor REQ2 can be permitted.

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeBankers-AlgorithmHelp-Line

Q62➡ | GATE 2014 Set-1
Consider the following set of processes that need to be scheduled on a single CPU. All the times are given in milliseconds.

Using the shortest remaining time first scheduling algorithm, the average process turnaround time (in msec) is .

Show Answer With Best Explanation

Answer: 7.2
Explanation: Upload Soon

More DiscussionExplanation On YouTube SchedulingHelp-Line

Q63➡ | GATE 2014 Set-1
Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is .

Show Answer With Best Explanation

Answer: 7
Explanation: Upload Soon

More DiscussionExplanation On YouTube Page-Replacement Help-Line

Q64➡ | GATE 2014 Set-2
A FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is 4 bytes in size. Given a 100 x 106 bytes disk on which the file system is stored and data block size is 103 bytes, the maximum size of a file that can be stored on this disk in units of 106 bytes is .

Show Answer With Best Explanation

Answer: 99.55 To 99.65
Explanation: Upload Soon

More DiscussionExplanation On YouTube file systemHelp-Line

Q65➡ | GATE 2014 Set-2
Consider the procedure below for the Producer-Consumer problem which uses semaphores:


Which one of the following is TRUE?
i ➥ The producer will be able to add an item to the buffer, but the consumer can never consume it.
ii ➥ The consumer will remove no more than one item from the buffer.
iii ➥ Deadlock occurs if the consumer succeeds in acquiring semaphore s when the buffer is empty.
iv ➥ The starting value for the semaphore n must be 1 and not 0 for deadlock-free operation.

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTube Producer-ConsumerHelp-Line

Q66➡ | GATE 2014 Set-2
Three processes A, B and C each execute a loop of 100 iterations. In each iteration of the loop, a process performs a single computation that requires tc CPU milliseconds and then initiates a single I/O operation that lasts for tio milliseconds. It is assumed that the computer where the processes execute has sufficient number of I/O devices and the OS of the computer assigns different I/O devices to each process. Also, the scheduling overhead of the OS is negligible. The processes have the following characteristics:            
  .
The processes A, B, and C are started at times 0, 5 and 10 milliseconds respectively, in a pure time sharing system (round robin scheduling) that uses a time slice of 50 milliseconds. The time in milliseconds at which process C would complete its first I/O operation is .

Show Answer With Best Explanation

Answer: 1000
Explanation: Upload Soon

More DiscussionExplanation On YouTube SchedulingHelp-Line

Q70➡ | GATE 2014 Set-2
A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page replacement policy for this program?
i ➥ Least-recently-used
ii ➥ First-in-first-out
iii ➥ Last-in-first-out
iv ➥ Most-recently-used

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTube Page-ReplacementHelp-Line

Q71➡ | GATE 2014 Set-3
A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?
4, 7, 6, 1, 7, 6, 1, 2, 7, 2
i ➥ 6
ii ➥ 7
iii ➥ 8
iv ➥ 9

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubePage Replacement AlgorithmHelp-Line

Q72➡ | GATE 2014 Set-3
A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise is .

Show Answer With Best Explanation

Answer: 7
Explanation: Upload Soon

More DiscussionExplanation On YouTube deadlock Help-Line

Q73➡ | GATE 2014 Set-3
An operating system uses shortest remaining time first scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival times and CPU burst times (in milliseconds):

The average waiting time (in milliseconds) of the processes is_____.

Show Answer With Best Explanation

Answer: 5.5
Explanation: Upload Soon

More DiscussionExplanation On YouTube SchedulingHelp-Line

Q74➡ | GATE 2014 Set-3
Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the effective memory access time (in milliseconds) is____.

Show Answer With Best Explanation

Answer: 122
Explanation: Upload Soon

More DiscussionExplanation On YouTube Page-Replacement Help-Line

Q75➡ | GATE 2013
A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (the lowest priority). The scheduler re-evaluates the process priorities every T time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time zero?
i ➥ This algorithm is equivalent to the first-come-first-serve algorithm.
ii ➥ This algorithm is equivalent to the round-robin algorithm.
iii ➥ This algorithm is equivalent to the shortest-job-first algorithm.
iv ➥ This algorithm is equivalent to the shortest-remaining-time-first algorithm.

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More Discussion Explanation On YouTube CPU Scheduling Help-Line

Q76➡ | GATE 2013
Three concurrent processes X, Y, and Z execute three different code segments that access and update certain shared variables. Process X
executes the P operation (i.e., wait) on semaphores a, b and c; process Y executes the P operation on semaphores b, c and d; process Z
executes the P operation on semaphores c, d, and a before entering the respective code segments. After completing the execution of
its code segment, each process invokes the V operation (i.e., signal) on its three semaphores. All semaphores are binary semaphores
initialized to one. Which one of the following represents a deadlock-free order of invoking the P operations by the processes?
i ➥ X: P(a)P(b)P(c) Y: P(b)P(c)P(d) Z: P(c)P(d)P(a)
ii ➥ X: P(b)P(a)P(c) Y: P(b)P(c)P(d) Z: P(a)P(c)P(d)
iii ➥ X: P(b)P(a)P(c) Y: P(c)P(b)P(d) Z: P(a)P(c)P(d)
iv ➥ X: P(a)P(b)P(c) Y: P(c)P(b)P(d) Z: P(c)P(d)P(a)

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess ManagementHelp-Line

Q77➡ | GATE 2013
A shared variable x, initialized to zero, is operated on by four concurrent processes W, X, Y, Z as follows. Each of the processes W and X reads x from memory, increments by one, stores it to memory, and then terminates. Each of the processes Y and Z reads x from memory, decrements by two, stores it to memory, and then terminates. Each process before reading x invokes the P operation (i.e., wait) on a counting semaphore S and invokes the V operation (i.e., signal) on the semaphore S after storing x to memory. Semaphore S is initialized to two. What is the maximum possible value of x after all processes complete execution?
i ➥ -2
ii ➥ -1
iii ➥ 1
iv ➥ 2

Show Answer With Best Explanation

Answer: IV
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process Synchronization Help-Line

Q78➡ | GATE 2013
Statement for Linked Answer Questions 78 and 79:

A computer uses 46-bit virtual address, 32-bit physical address, and a three-level paged page table organization. The page table base register stores the base address of the first-level table (T1), which occupies exactly one page. Each entry of T1 stores the base address of a page of the second-level table (T2). Each entry of T2 stores the base address of a page of the third-level table (T3). Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16-way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.

What is the size of a page in KB in this computer?
i ➥ 2
ii ➥ 4
iii ➥ 8
iv ➥ 16

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTube Memory Management Help-Line

Q79➡ | GATE 2013
Statement for Linked Answer Questions 78 and 79:

A computer uses 46-bit virtual address, 32-bit physical address, and a three-level paged page table organization. The page table base register stores the base address of the first-level table (T1), which occupies exactly one page. Each entry of T1 stores the base address of a page of the second-level table (T2). Each entry of T2 stores the base address of a page of the third-level table (T3). Each entry of T3 stores a page table entry (PTE). The PTE is 32 bits in size. The processor used in the computer has a 1 MB 16-way set associative virtually indexed physically tagged cache. The cache block size is 64 bytes.

What is the minimum number of page colours needed to guarantee that no two synonyms map to different sets in the processor cache of this computer?
i ➥ 2
ii ➥ 4
iii ➥ 8
iv ➥ 16

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeMemory Management Help-Line

Q80➡ | GATE 2012
A process executes the code
fork();
fork();
fork();
The total number of child processes created is
i ➥ 3
ii ➥ 4
iii ➥ 7
iv ➥ 8

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTube fork System call Help-Line

Q82➡ | GATE 2012
Fetch_And_Add(X,i) is an atomic Read-Modify-Write instruction that reads the value of memory location X, increments it by the value i, and returns the old value of X. It is used in the pseudocode shown below to implement a busy-wait lock. L is an unsigned integer shared variable initialized to 0. The value of 0 corresponds to lock being available, while any non-zero value corresponds to the lock being not available.

This implementation
i ➥ fails as L can overflow
ii ➥ fails as L can take on a non-zero value when the lock is actually available
iii ➥ works correctly but may starve some processes
iv ➥ works correctly without starvation

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess SynchronizationHelp-Line

Q83➡ | GATE 2012
Consider the 3 processes, P1, P2 and P3 shown in the table.

The completion order of the 3 processes under the policies FCFS and RR2 (round robin scheduling with CPU quantum of 2 time units) are
i ➥ FCFS: P1, P2, P3 RR2: P1, P2, P3
ii ➥ FCFS: P1, P3, P2 RR2: P1, P3, P2
iii ➥ FCFS: P1, P2, P3 RR2: P1, P3, P2
iv ➥ FCFS: P1, P3, P2 RR2: P1, P2, P3

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process Scheduling Help-Line

Q84➡ | GATE 2012
A file system with 300 GByte disk uses a file descriptor with 8 direct block addresses, 1 indirect block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and the size of each disk block address is 8 Bytes. The maximum possible file size in this file system is
i ➥ 3 KBytes
ii ➥ 35 KBytes
iii ➥ 280 KBytes
iv ➥ dependent on the size of the disk

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeFile System Help-Line

Q85➡ | GATE 2012
Consider the virtual page reference string
1, 2, 3, 2, 4, 1, 3, 2, 4, 1
On a demand paged virtual memory system running on a computer system that main memory size of 3 pages frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacements policy. Then
i ➥ OPTIMAL < LRU < FIFO
ii ➥ OPTIMAL < FIFO < LRU
iii ➥ OPTIMAL = LRU
iv ➥ OPTIMAL = FIFO

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubePage Replacement AlgorithmHelp-Line

Q86➡ | GATE 2011
Let the time taken to switch between user and kernel modes of execution be t1 while the time taken to switch between two processes be t2. Which of the following is TRUE?
i ➥ (t1) > (t2)
ii ➥ (t1) = (t2)
iii ➥ (t1) < (t2)
iv ➥ Nothing can be said about the relation between t1 and t2

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTube Context Switching Help-Line

Q87➡ | GATE 2011
A thread is usually defined as a “light weight process” because an operating system (OS) maintains smaller data structures for a thread than for a process. In relation to this, which of the following is TRUE?
i ➥ On per-thread basis, the OS maintains only CPU register state
ii ➥ The OS does not maintain a separate stack for each thread
iii ➥ On per-thread basis, the OS does not maintain virtual memory state
iv ➥ On per thread basis, the OS maintains only scheduling and accounting information

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTubeThreads Help-Line

Q88➡ | GATE 2011
Let the page fault service time to 10 ms in a computer with average memory access time being 20 ns. If one page fault is generated for every 106 memory accesses, what is the effective access time for the memory?
i ➥ 21 ns
ii ➥ 30 ns
iii ➥ 23 ns
iv ➥ 35 ns

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeMemory ManagementHelp-Line

Q89➡ | GATE 2011
Consider the following table of arrival time and burst time for three processes P0, P1 and P2.

The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?
i ➥ 5.0 ms
ii ➥ 4.33 ms
iii ➥ 6.33 ms
iv ➥ 7.33 ms

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process SchedulingHelp-Line

Q90➡ | GATE 2010
Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned.

Which one of the following statements describes the properties achieved?
i ➥ Mutual exclusion but not progress
ii ➥ Progress but not mutual exclusion
iii ➥ Neither mutual exclusion nor progress
iv ➥ Both mutual exclusion and progress

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTubeProcess SynchronizationHelp-Line

Q91➡ | GATE 2010
A system uses FIFO policy for page replacement. It has 4 page frames with no pages loaded to begin with. The system first accesses 100 distinct pages in some order and then accesses the same 100 pages but now in the reverse order. How many page faults will occur?
i ➥ 196
ii ➥ 192
iii ➥ 197
iv ➥ 195

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTube Page ReplacementHelp-Line

Q92➡ | GATE 2010
Which of the following statements are true?
I. Shortest remaining time first scheduling may cause starvation
II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of response time
i ➥ I only
ii ➥ I and III only
iii ➥ II and III only
iv ➥ I, II and III

Show Answer With Best Explanation

Answer: III
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process-SchedulingHelp-Line

Q93➡ | GATE 2010
The following program consists of 3 concurrent processes and 3 binary semaphores.The semaphores are initialized as S0 = 1, S1 = 0, S2 = 0.

How many times will process P0 print ‘0’?
i ➥ At least twice
ii ➥ Exactly twice
iii ➥ Exactly thrice
iv ➥ Exactly once

Show Answer With Best Explanation

Answer: I
Explanation: Upload Soon

More DiscussionExplanation On YouTube Process SynchronizationHelp-Line

Q94➡ | GATE 2010
A system has n resources R0,…,Rn-1,and k processes P0,….Pk-1.The implementation of the resource request logic of each process Pi is as follows:
if (i % 2 == 0)
{
if (i < n) request Ri
if (i+2 < n) request Ri+2
}
else
{
if (i < n) request Rn-i
if (i+2 < n) request Rn-i-2
}
In which one of the following situations is a deadlock possible?
i ➥ n = 40, k = 26
ii ➥ n = 21, k = 12
iii ➥ n = 20, k = 10
iv ➥ n = 41, k = 19

Show Answer With Best Explanation

Answer: II
Explanation: Upload Soon

More DiscussionExplanation On YouTubeDeadlockHelp-Line

Leave a Reply

Your email address will not be published.

error: Content is protected !!
Open chat
1
Hi,how Can We Help You ?