My Report

Operating System Practice Test 2


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 5%

Question 1 of 20

1. Complex scheduling algorithms ____________

Question 1 of 20

Question 2 of 20

2. 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?

Question 2 of 20

Question 3 of 20

3. 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. (GATE 2010)

Method used by P1 :
while(S1==S2);
Critical section
S1 = S2;

Method used by P2 :
while(S1!=S2);
Critical section
S2 = not(S1);

Which of the following statements describes properties achieved?

Question 3 of 20

Question 4 of 20

4. A monitor is a type of ____________

Question 4 of 20

Question 5 of 20

5. Which one of the following is a visual ( mathematical ) way to determine the deadlock occurrence?

Question 5 of 20

Question 6 of 20

6. An SJF algorithm is simply a priority algorithm where the priority is ____________

Question 6 of 20

Question 7 of 20

7. For sharable resources, mutual exclusion ____________

Question 7 of 20

Question 8 of 20

8. What is a reusable resource?

Question 8 of 20

Question 9 of 20

9. Choose one of the disadvantages of the priority scheduling algorithm?

Question 9 of 20

Question 10 of 20

10. Consider a transaction T1 that committed prior to checkpoint. The <T1 commits> record appears in the log before the <checkpoint> record. Any modifications made by T1 must have been written to the stable storage either with the checkpoint or prior to it. Thus at recovery time ____________

Question 10 of 20

Question 11 of 20

11. For non sharable resources like a printer, mutual exclusion ____________

Question 11 of 20

Question 12 of 20

12. Which of the following conditions must be satisfied to solve the critical section problem?

Question 12 of 20

Question 13 of 20

13. Mutual exclusion implies that ____________

Question 13 of 20

Question 14 of 20

14. The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores are initialized as S0 = 1, S1 = 0, S2 = 0.

Process P0
while(true)
{
    wait(S0);
    print '0';
    release(S1);
    release(S2);
}

Process P1
wait(S1);
release(S0);

Process P2
wait(S2);
release(S0);

How many times will P0 print '0'?

Question 14 of 20

Question 15 of 20

15. Bounded waiting implies that there exists a bound on the number of times a process is allowed to enter its critical section ____________

Question 15 of 20

Question 16 of 20

16. A deadlock free solution to the dining philosophers problem ____________

Question 16 of 20

Question 17 of 20

17. The dining - philosophers problem will occur in case of ____________

Question 17 of 20

Question 18 of 20

18. What are Spinlocks?

Question 18 of 20

Question 19 of 20

19. Which is the process of invoking the wait operation?

Question 19 of 20

Question 20 of 20

20. All processes share a semaphore variable mutex, initialized to 1. Each process must execute wait(mutex) before entering the critical section and signal(mutex) afterward.
Suppose a process executes in the following manner.

signal(mutex);
.....
critical section
.....
wait(mutex);

In this situation :

Question 20 of 20


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.