1. Match the following: [Paper III December 2012]
List – I List – II
a. Critical region 1. Hoares Monitor
b. Wait/signal 2. Mutual exclusion
c. Working set 3. Principal of locality
d. Dead lock 4. Circular wait
Codes :
a b c d
(A) 2 1 3 4
(B) 1 2 4 3
(C) 2 3 1 4
(D) 1 3 2 4
2. Which of the following features will characterize an OS as multiprogrammed OS?
(a) More than one program may be loaded into main memory at the same time.
(b) If a program waits for certain event another program is immediately scheduled.
(c) If the execution of a program terminates, another program is immediately scheduled.
[Paper III December 2012]
(A) (a) only
(B) (a) and (b) only
(C) (a) and (c) only
(D) (a), (b) and (c) only
3. A thread is a light weight process. In the above statement, weight refers to: [Paper III December 2012]
(A) time
(B) number of resources
(C) speed
(D) All the above
4. Everything below the system call interface and above the physical hardware is known as ______.
[Paper III December 2012]
(A) Kernel
(B) Bus
(C) Shell
(D) Stub
5. Which of the following operating system is better for implementing client-server network?
[Paper III December 2012]
(A) Windows 95
(B) Windows 98
(C) Windows 2000
(D) All of these
(B) 9
(C) 10
(D) 13
(B) q ≥ (t – ns)/(n – 1)
(C) q ≤ (t – ns)/(n + 1)
(D) q ≥ (t – ns)/(n + 1)
Critical region: In concurrent programming, a critical section/region is a piece of code that accesses a shared resource that must not be concurrently accessed by more than one thread of execution. Some synchronization mechanism is required at the entry and exit of the critical section to ensure exclusive use (Mutual exclusion), for example a semaphore.
Hoare’s Monitor: Monitors used for synchronization were invented by C. A. R. Hoare
A program's working set W(t,T) at time t is the set of distinct pages among the T most recently referenced pages.
Necessary Condition for deadlock to occur: Hold and wait, Circular wait, Mutual exclusion, No pre-emption
2. D
3. B
4. A
5. C
6. D
7. B
List – I List – II
a. Critical region 1. Hoares Monitor
b. Wait/signal 2. Mutual exclusion
c. Working set 3. Principal of locality
d. Dead lock 4. Circular wait
Codes :
a b c d
(A) 2 1 3 4
(B) 1 2 4 3
(C) 2 3 1 4
(D) 1 3 2 4
2. Which of the following features will characterize an OS as multiprogrammed OS?
(a) More than one program may be loaded into main memory at the same time.
(b) If a program waits for certain event another program is immediately scheduled.
(c) If the execution of a program terminates, another program is immediately scheduled.
[Paper III December 2012]
(A) (a) only
(B) (a) and (b) only
(C) (a) and (c) only
(D) (a), (b) and (c) only
3. A thread is a light weight process. In the above statement, weight refers to: [Paper III December 2012]
(A) time
(B) number of resources
(C) speed
(D) All the above
4. Everything below the system call interface and above the physical hardware is known as ______.
[Paper III December 2012]
(A) Kernel
(B) Bus
(C) Shell
(D) Stub
5. Which of the following operating system is better for implementing client-server network?
[Paper III December 2012]
(A) Windows 95
(B) Windows 98
(C) Windows 2000
(D) All of these
6. Consider a system having m resources of the same type. These resources are shared by 3 processes A, B and C which have peak demands of 3, 4 and 6 respectively. For what value of m deadlock will not occur? [Paper III December 2012]
(A) 7(B) 9
(C) 10
(D) 13
7. Consider n processes sharing the CPU in round robin fashion. Assuming that each process switch takes s seconds, what must be the quantum size q such that the overhead resulting from process switching is minimized but, at the same time each process is guaranteed to get its turn at the CPU at least every t seconds? [Paper III December 2012]
(A) q ≤ (t – ns)/(n – 1)(B) q ≥ (t – ns)/(n – 1)
(C) q ≤ (t – ns)/(n + 1)
(D) q ≥ (t – ns)/(n + 1)
8. Dijkestra banking algorithm
in an operating system, solves the problem of
[Paper
II December 2011]
(A) deadlock avoidance
(B) deadlock recovery
(C) mutual exclusion
(D) context switching
9. The multiuser operating
system, 20 requests are made to use a particular resource per hour, on an
average the probability that no request are made in 45 minutes is [Paper II December 2011]
(A) e–15 (B) e–5
(C) 1 – e–5 (D) 1 – e–10
10. On receiving an interrupt
from an I/O device, the CPU [Paper II
December 2011]
(A) halts for predetermined time.
(B) branches off to the interrupt service routine
after completion of the current instruction.
(C) branches off to the interrupt service routine
immediately.
(D) hands over control of address bus and data bus
to the interrupting device.
SOLUTION
1. ACritical region: In concurrent programming, a critical section/region is a piece of code that accesses a shared resource that must not be concurrently accessed by more than one thread of execution. Some synchronization mechanism is required at the entry and exit of the critical section to ensure exclusive use (Mutual exclusion), for example a semaphore.
Hoare’s Monitor: Monitors used for synchronization were invented by C. A. R. Hoare
A program's working set W(t,T) at time t is the set of distinct pages among the T most recently referenced pages.
Necessary Condition for deadlock to occur: Hold and wait, Circular wait, Mutual exclusion, No pre-emption
2. D
3. B
4. A
5. C
6. D
Deadlock occurs when one process is holding a resource and another is waiting for it, which continues in a circular fashion. In short there is a possibility of deadlock when a process acquires the resources that it need partially and waits for another resource acquired by another process. Here the peak demand for each processes A, B and C is given as 3, 4 and 6 respectively. Suppose the peak demand for all the three processes happens simultaneously then we will require 3 + 4 + 6 = 13 resources to satisfy the demand. So to avoid the hold and wait condition we require 13 resources. But Hold and wait alone will not cause deadlock (refer solution to Question 1). We also need a circular wait condition. What can be the maximum number of resources that can be allocated and still a circular wait occur? It is 10. Suppose A gets 2 resources and wait for the third from B which has got 3 resources and is waiting for the forth from C, which got 5 and waits for the sixth from A. But when we have 11 resources any one of the processes get sufficient number of resources and the circular wait chain breaks resulting in the avoidance of deadlock. So the minimum number of resources that can avoid deadlock is 11. But we don’t have that option here, so the answer is 13.
7. B
No comments:
Post a Comment