Explore topic-wise MCQs in Operating System.

This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your Operating System knowledge and support exam preparation. Choose a topic below to get started.

1.

In the context of concurrency control, a given pair of operations in a schedule is called conflict schedule if(A) At least one of the operations is write operation(B) Both the operations are performed on the same data item(C) Both the operations are performed by different transactions(D) Both the operations are performed on different data itemsChoose the correct answer from the options given below:

A. (A) and (B) only
B. (A), (B) and (C) only
C. (A), (C) and (D) only
D. (C) and (D) only
Answer» C. (A), (C) and (D) only
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:function OWNRESOURCES(Resource R)Acquire lock L / / a global lockif R is available thenAcquire RRelease lock Lelseif R is owned by another process P thenTerminate P, after releasing all resources owned by PAcquire RRestart PRelease lock Lend ifend ifend functionWhich of the following choice(s) about the above scheme is/are correct?

A. The scheme may lead to starvation.
B. The scheme may lead to live-lock.
C. The scheme ensures that deadlocks will not occur.
D. The scheme violates the mutual exclusion property.
Answer» B. The scheme may lead to live-lock.
3.

Processes P1 and P2 have a producer-consumer relationship, communicating by the use of a set of shared buffers.P1: repeat Obtain a full buffer Empty it Return an empty bufferforeverP2" id="MathJax-Element-4-Frame" role="presentation" style=" position: relative;" tabindex="0">P2P2" role="presentation" style=" position: relative;" tabindex="0">P2P2: repeat Obtain a full buffer Empty it Return an empty buffer foreverIncreasing the number of buffers is likely to do which of the following?I. Increase the rate at which requests are satisfied (throughput)II. Decrease the likelihood of deadlockIII. Increase the ease of achieving a correct implementation

A. III only
B. II only
C. I only
D. II and II only
Answer» D. II and II only
4.

In multi-programmed systems, it is advantageous if some programs such as editors and compilers can be shared by several users.Which of the following must be true of multi-programmed systems in order that a single copy of a program can be shared by several users?I. The program is a macroll. The program is recursivelll. The program is reentrant

A. I only
B. II only
C. III only
D. I, II and III
Answer» D. I, II and III
5.

Choose two statements in context of monitor based synchronization scheme that use condition type variable x:I: Only wait () and signal () operations can be involved on X.II: If process p invokes X, wait() operation; then P is suspended until another process invokes X, signal().III: The X, signal() operation resumes exactly one suspended process and if no process is suspended, the it has no effect.

A. I and II
B. II and III
C. I and III
D. I, II and III
Answer» B. II and III
6.

Consider the following pseudocode, where S is a semaphore intialized to 5 in line#2 an counter is a shared variable intialized to 0 in line#1. Assume that the increment operation in line#7 is not atomic.1. int counter = 0;2. Semaphore S = init(5);3. void parop(void)4. {5. wait (S);6. wait (S);7. counter++;8. signal (S);9. signal (S);10. }If five threads execute the function parop concurrently, which of the following program behavior (s) is/are possible?

A. There is a deadlock involving all the threads.
B. The value of counter is 5 after all the threads successfully complete the execution of parop.
C. The value of counter is 1 after all the threads successfully complete the execution of parop.
D. The value of counter is 0 after all the threads successfully complete the execution of parop.
Answer» B. The value of counter is 5 after all the threads successfully complete the execution of parop.