UGC NET · PAPER 2
UGC NET Paper 2 Computer Science – Operating Systems PYQ: Process Synchronization, Deadlocks & IPC
Q1.
Which of the following statements are CORRECT?
(A) A process always checks the state of the currently executing process to enter its critical section.
(B) Spin locks use busy waiting.
(C) Periodically testing a variable until some value appears is known as busy waiting.
(D) A critical region/section is the part of a program where shared memory (a shared resource) is accessed.
(E) A printer daemon continuously checks to see if there are any files to be printed.
(A) A process always checks the state of the currently executing process to enter its critical section.
(B) Spin locks use busy waiting.
(C) Periodically testing a variable until some value appears is known as busy waiting.
(D) A critical region/section is the part of a program where shared memory (a shared resource) is accessed.
(E) A printer daemon continuously checks to see if there are any files to be printed.
- (A) (A) and (B) only
- (B) (B) and (C) only
- (C) (B) and (D) only
- (D) (B) and (E) only
Q2.
At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operations and 'x' V operations were performed on this semaphore. If the final value of the semaphore is 5, what is x?
- (A) 15
- (B) 22
- (C) 18
- (D) 13
Q3.
Match List I with List II:
List I: (A) Critical region (B) Wait/Signal (C) Working set (D) Deadlock
List II: (I) Hoare's monitor (II) Mutual exclusion (III) Principle of locality (IV) Circular wait
Choose the correct match from A-D to I-IV.
List I: (A) Critical region (B) Wait/Signal (C) Working set (D) Deadlock
List II: (I) Hoare's monitor (II) Mutual exclusion (III) Principle of locality (IV) Circular wait
Choose the correct match from A-D to I-IV.
- (A) A-IV, B-I, C-III, D-II
- (B) A-II, B-I, C-III, D-IV
- (C) A-I, B-II, C-III, D-IV
- (D) A-IV, B-III, C-I, D-II
Q4.
At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operations and 'x' V operations were performed on this semaphore. If the final value of the semaphore is 5, what is x?
- (A) 15
- (B) 22
- (C) 18
- (D) 14
Q5.
Match List I with List II:
List I: (A) Critical region (B) Wait/Signal (C) Working set (D) Deadlock
List II: (I) Hoare's monitor (II) Mutual exclusion (III) Principle of locality (IV) Circular wait
Choose the correct match from A-D to I-IV.
List I: (A) Critical region (B) Wait/Signal (C) Working set (D) Deadlock
List II: (I) Hoare's monitor (II) Mutual exclusion (III) Principle of locality (IV) Circular wait
Choose the correct match from A-D to I-IV.
- (A) A-IV, B-I, C-III, D-II
- (B) A-II, B-I, C-III, D-IV
- (C) A-I, B-II, C-III, D-IV
- (D) A-IV, B-III, C-I, D-II
Q6.
In the design protocol of the critical section problem, each process must ask permission to enter the critical section in …… code; it then executes in the critical section; once it finishes executing in the critical section it enters the …… code. The process then enters the …… code.
- (A) entry section, remainder section, exit section
- (B) entry section, exit section, remainder section
- (C) remainder section, entry section, exit section
- (D) remainder section, exit section, entry section
Q7.
Consider a system with five processes P0 through P4 and three resource types A, B and C, with 7, 2 and 6 total instances respectively. At time T0 the system state is:
Available = (0, 0, 0). Applying the deadlock detection algorithm, the system is:
| Process | Allocation (A,B,C) | Request (A,B,C) | ||||
|---|---|---|---|---|---|---|
| P0 | 0 | 1 | 0 | 0 | 0 | 0 |
| P1 | 2 | 0 | 0 | 2 | 0 | 2 |
| P2 | 3 | 0 | 3 | 0 | 0 | 0 |
| P3 | 2 | 1 | 1 | 1 | 0 | 0 |
| P4 | 0 | 2 | 2 | 0 | 0 | 2 |
- (A) Semaphore
- (B) Deadlock state
- (C) Circular wait
- (D) Not in deadlock state
Q8.
The Bounded Buffer problem is also known as the ________.
- (A) Producer–Consumer problem
- (B) Reader–Writer problem
- (C) Dining Philosophers problem
- (D) Both (ii) and (iii)
Q9.
Two atomic operations permissible on semaphores are ________ and ________.
- (A) wait, stop
- (B) wait, hold
- (C) hold, signal
- (D) wait, signal
Q10.
Three processes share a single counting semaphore S whose initial value is 1. All three execute wait(S) one after another, in the order P2, P1, P3. After this, P2 exits its critical section by executing signal(S), and then P1 exits by executing signal(S). What is the value of S after these five operations?
- (A) 0
- (B) 1
- (C) -1
- (D) -2
Q11.
In the UNIX operating system, when a process creates a child process using the fork() system call, which of the following is genuinely shared between the parent and child process, rather than being copied?
- (A) Heap
- (B) Stack
- (C) Shared memory segments
- (D) Both Heap and Stack
Q12.
A system has 12 instances of a resource R shared among four processes. The maximum need and current allocation of each process are:
With reference to the current allocation, is the system in a safe state? If so, what is a safe sequence?
| Process | Max Need | Current Allocation |
|---|---|---|
| P1 | 8 | 3 |
| P2 | 9 | 4 |
| P3 | 5 | 2 |
| P4 | 3 | 1 |
- (A) No
- (B) Yes, P1 P2 P3 P4
- (C) Yes, P4 P3 P1 P2
- (D) Yes, P2 P1 P3 P4