Operating system mcqs semaphores

ALL PRINTABLE PDF BOOKS FREE DOWNLOAD <<CLICK HERE>>

Operating system mcqs semaphores

Question 1 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What are the two kinds of semaphores?
A
mutex & counting
B
binary & counting
C
counting & decimal
D
decimal & binary
Question 2 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The program follows to use a shared binary semaphore T. Process A int Y; A1: Y = X*2; A2: X = Y; signal(T); Process B int Z; B1: wait(T); B2: Z = X+1; X = Z; T is set to 0 before either process begins execution and, as before, X is set to 5. Now, how many different values of X are possible after both processes finish executing?
A
one
B
two
C
three
D
four
Question 2 Explanation: 
The semaphore T ensures that all the statements from A finish execution before B begins. So now there is only one way in which statements from A and B can be interleaved: A1 A2 B1 B2: X = 11.
Question 3 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
At a particular time of computation the value of a counting semaphore is 7.Then 20 P operations and 15 V operations were completed on this semaphore. The resulting value of the semaphore is? (GATE 1987)
A
42
B
2
C
7
D
12
Question 3 Explanation: 
P represents Wait and V represents Signal. P operation will decrease the value by 1 every time and V operation will increase the value by 1 every time.
Question 4 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The following pair of processes share a common variable X. Process A int Y; A1: Y = X*2; A2: X = Y; Process B int Z; B1: Z = X+1; B2: X = Z; X is set to 5 before either process begins execution. As usual, statements within a process are executed sequentially, but statements in process A may execute in any order with respect to statements in process B. How many different values of X are possible after both processes finish executing?
A
two
B
three
C
four
D
eight
Question 4 Explanation: 
Here are the possible ways in which statements from A and B can be interleaved. A1 A2 B1 B2: X = 11 A1 B1 A2 B2: X = 6 A1 B1 B2 A2: X = 10 B1 A1 B2 A2: X = 10 B1 A1 A2 B2: X = 6 B1 B2 A1 A2: X = 12.
Question 5 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Spinlocks are intended to provide ..... only.
A
Mutual Exclusion
B
Bounded Waiting
C
Aging
D
Progress
There are 5 questions to complete.

DOWNLOAD ALL SUBJECTS PDF <<CLICK HERE>>