Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Test: Process Synchronization- 2 - Computer Science Engineering (CSE) MCQ

Test: Process Synchronization- 2 - Computer Science Engineering (CSE) MCQ


Test Description

20 Questions MCQ Test - Test: Process Synchronization- 2

Test: Process Synchronization- 2 for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Test: Process Synchronization- 2 questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Process Synchronization- 2 MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Process Synchronization- 2 below.
Solutions of Test: Process Synchronization- 2 questions in English are available as part of our course for Computer Science Engineering (CSE) & Test: Process Synchronization- 2 solutions in Hindi for Computer Science Engineering (CSE) course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Process Synchronization- 2 | 20 questions in 55 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Process Synchronization- 2 - Question 1

What is the name of the operating system that reads and reacts in terms of actual time.

Detailed Solution for Test: Process Synchronization- 2 - Question 1

A real-time operating system is an operating system that guarantees to process events or data by a specific moment in time. Option (C) is correct.

Test: Process Synchronization- 2 - Question 2

Which of the following need not necessarily be saved on a Context Switch between processes?

Detailed Solution for Test: Process Synchronization- 2 - Question 2

The values stored in registers, stack pointers and program counters are saved on context switch between the processes so as to resume the execution of the process. There's no need for saving the contents of TLB as it is being invalid after each context switch. So, option (B) is correct

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Process Synchronization- 2 - Question 3

Fork is

Detailed Solution for Test: Process Synchronization- 2 - Question 3

fork() creates a new process by duplicating the calling process, The new process, referred to as child, is an exact duplicate of the calling process, referred to as parent, except for the following : The child has its own unique process ID, and this PID does not match the ID of any existing process group. The child’s parent process ID is the same as the parent’s process ID. The child does not inherit its parent’s memory locks and semaphore adjustments. The child does not inherit outstanding asynchronous I/O operations from its parent nor does it inherit any asynchronous I/O contexts from its parent. So, option (D) is correct.

Test: Process Synchronization- 2 - Question 4

Dining Philosopher's problem is a:

Detailed Solution for Test: Process Synchronization- 2 - Question 4

Dining Philosopher's problem is a Classical IPC problem. Option (B) is correct.

Test: Process Synchronization- 2 - Question 5

Round Robin schedule is essentially the pre-emptive version of

Detailed Solution for Test: Process Synchronization- 2 - Question 5

FIFO when implemented in preemptive version, acts like a round-robin algorithm. So, option (A) is correct.

Test: Process Synchronization- 2 - Question 6

Consider a set of n tasks with known runtimes r1, r2....rn to be run on a uniprocessor machine. Which of the following processor scheduling algorithms will result in the maximum throughput?

Detailed Solution for Test: Process Synchronization- 2 - Question 6

Throughput means total number of tasks executed per unit time i.e. sum of waiting time and burst time. Shortest job first scheduling is a scheduling policy that selects the waiting process with the smallest execution time to execute next. Thus, in shortest job first scheduling, shortest jobs are executed first. This means CPU utilization is maximum. So, maximum number of tasks are completed. Option (B) is correct.

Test: Process Synchronization- 2 - Question 7

In an operating system, indivisibility of operation means:

Detailed Solution for Test: Process Synchronization- 2 - Question 7

In an operating system, indivisibility of operation means processor can not be pre-empted. One a process starts its execution it will not suspended or stop its execution inside the processor. So, option (C) is correct.

Test: Process Synchronization- 2 - Question 8

Which is the correct definition of a valid process transition in an operating system?

Detailed Solution for Test: Process Synchronization- 2 - Question 8

The statetransition diagram of a process(preemptive scheduling):

Option 1: Wake up: ready → running It is incorrect as when a process wakes up it is shifted from blocked state to ready state and not from ready to running. Option 2: Dispatch: ready → running It is correct as the dispatcher selectively assigns the CPU to one of the process in the ready queue based on a well defined algorithm. Option 3: Block: ready → running It is incorrect as a process is blocked when it is either pre-empted by some other process or due to some i/o operation. So when a process gets blocked it shifts from running state to blocked state. Option 4: Timer runout: ready → running When the time duration of execution of a process expires, the timer interrupts and the process shifts from the running state to ready queue. So, option (B) is correct.

Test: Process Synchronization- 2 - Question 9

The performance of Round Robin algorithm depends heavily on

Detailed Solution for Test: Process Synchronization- 2 - Question 9

In round robin algorithm, the size of time quanta plays a very important role as: If size of quanta is too small: Context switches will increase and it is counted as the waste time, so CPU utilization will decrease. If size of quanta is too large: Larger time quanta will lead to Round robin regenerated into FCFS scheduling algorithm. So, option (D) is correct.

Test: Process Synchronization- 2 - Question 10

Process is:

Detailed Solution for Test: Process Synchronization- 2 - Question 10

A process is termed as a program in execution. Whenever a program needs to be executed, its process image is created inside the main memory and is placed in the ready queue. Later CPU is assigned to the process and it starts its execution. So, option (C) is correct.

Test: Process Synchronization- 2 - Question 11

Four jobs to be executed on a single processor system arrive at time 0 in the order A, B, C, D . Their burst CPU time requirements are 4, 1, 8, 1 time units respectively. The completion time of A under round robin scheduling with time slice of one time unit is

Detailed Solution for Test: Process Synchronization- 2 - Question 11

The order of execution of the processes with the arrival time of each process = 0, using round robin algorithm with time quanta = 1 A B C D A C A C A, i.e, after 8 context switches, A finally completes it execution So, the correct option is (D).

Test: Process Synchronization- 2 - Question 12

There are three processes in the ready queue. When the currently running process requests for I/O how many process switches take place?

Detailed Solution for Test: Process Synchronization- 2 - Question 12

Single process switch will take place as when the currently running process requests for I/O, it would be placed in the blocked list and the first process residing inside the Ready Queue will be placed in the Running list to start its execution. Option (A) is correct.

Test: Process Synchronization- 2 - Question 13

Two processes X and Y need to access a critical section. Consider the following synchronization construct used by both the processes.

Q20

Here, varP and varQ are shared variables and both are initialized to false. Which one of the following statements is true?

Detailed Solution for Test: Process Synchronization- 2 - Question 13

When both processes try to enter critical section simultaneously,both are allowed to do so since both shared variables varP and varQ are true.So, clearly there is NO mutual exclusion. Also, deadlock is prevented because mutual exclusion is one of the four conditions to be satisfied for deadlock to happen.Hence, answer is A.

Test: Process Synchronization- 2 - Question 14

In a certain operating system, deadlock prevention is attempted using the following scheme. Each process is assigned a unique timestamp, and is restarted with the same timestamp if killed. Let Ph be the process holding a resource R, Pr be a process requesting for the same resource R, and T(Ph) and T(Pr) be their timestamps respectively. The decision to wait or preempt one of the processes is based on the following algorithm.
 if T(Pr) < T(Ph)

then kill Pr

else wait
Which one of the following is TRUE?

Detailed Solution for Test: Process Synchronization- 2 - Question 14
  1. This scheme is making sure that the timestamp of requesting process is always lesser than holding process
  2. The process is restarted with same timestamp if killed and that timestamp can NOT be greater than the existing time stamp

From 1 and 2,it is clear that any new process coming having LESSER timestamp will be KILLED.So,NO DEADLOCK possible However, a new process will lower timestamp may have to wait  infinitely because of its LOWER timestamp(as killed process will also have same timestamp ,as it was killed earlier).STARVATION IS Definitely POSSIBLE So Answer is A

Test: Process Synchronization- 2 - Question 15

Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the processes P and Q is shown below.

Process P:
while (1) {
W:
   print '0';
   print '0';
X:
}
    
Process Q:
while (1) {
Y:
   print '1';
   print '1';
Z:
}

Synchronization statements can be inserted only at points W, X, Y and Z. Which of the following will always lead to an output staring with '001100110011' ?

Detailed Solution for Test: Process Synchronization- 2 - Question 15

P(S) means wait on semaphore ‘S’ and V(S) means signal on semaphore ‘S’. [sourcecode] Wait(S) { while (i <= 0) --S; } Signal(S) { S++; } [/sourcecode] Initially, we assume S = 1 and T = 0 to support mutual exclusion in process P and Q. Since S = 1, only process P will be executed and wait(S) will decrement the value of S. Therefore, S = 0. At the same instant, in process Q, value of T = 0. Therefore, in process Q, control will be stuck in while loop till the time process P prints 00 and increments the value of T by calling the function V(T). While the control is in process Q, semaphore S = 0 and process P would be stuck in while loop and would not execute till the time process Q prints 11 and makes the value of S = 1 by calling the function V(S). This whole process will repeat to give the output 00 11 00 11 … .
 
Thus, B is the correct choice.

Test: Process Synchronization- 2 - Question 16

Which of the following does not interrupt a running process?

Detailed Solution for Test: Process Synchronization- 2 - Question 16

Scheduler process doesn’t interrupt any process, it’s Job is to select the processes for following three purposes. Long-term scheduler(or job scheduler) –selects which processes should be brought into the ready queue Short-term scheduler(or CPU scheduler) –selects which process should be executed next and allocates CPU. Mid-term Scheduler (Swapper)- present in all systems with virtual memory, temporarily removes processes from main memory and places them on secondary memory (such as a disk drive) or vice versa. The mid-term scheduler may decide to swap out a process which has not been active for some time, or a process which has a low priority, or a process which is page faulting frequently, or a process which is taking up a large amount of memory in order to free up main memory for other processes, swapping the process back in later when more memory is available, or when the process has been unblocked and is no longer waiting for a resource.

Test: Process Synchronization- 2 - Question 17

What is the name of the technique in which the operating system of a computer executes several programs concurrently by switching back and forth between them?

Detailed Solution for Test: Process Synchronization- 2 - Question 17

In a multitasking system, a computer executes several programs simultaneously by switching them back and forth to increase the user interactivity. Processes share the CPU and execute in an interleaving manner. This allows the user to run more than one program at a time. Option (B) is correct.

Test: Process Synchronization- 2 - Question 18

A task in a blocked state

Detailed Solution for Test: Process Synchronization- 2 - Question 18

Waiting or Blocked state is when a process has requested some input/output and is waiting for the resource. So, option (D) is correct.

Test: Process Synchronization- 2 - Question 19

Consider the following statements about process state transitions for a system using preemptive scheduling.

I. A running process can move to ready state.
II. A ready process can move to running state.
III. A blocked process can move to running state.
IV. A blocked process can move to ready state.

Which of the above statements are TRUE ?

Detailed Solution for Test: Process Synchronization- 2 - Question 19

According to process state transitions for a system using preemptive scheduling:

So, a blocked process can NOT move to running state. Only statements I, II, and IV are correct. Option (C) is true.

Test: Process Synchronization- 2 - Question 20

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.
Method Used by P1
while (S1 == S2) ;
Critica1 Section
S1 = S2;

Method Used by P2
while (S1 != S2) ;
Critica1 Section
S2 = not (S1);
Which one of the following statements describes the properties achieved?

Detailed Solution for Test: Process Synchronization- 2 - Question 20

It can be easily observed that the Mutual Exclusion requirement is satisfied by the above solution, P1 can enter critical section only if S1 is not equal to S2, and P2 can enter critical section only if S1 is equal to S2. But here Progress Requirement is not satisfied. Suppose when s1=1 and s2=0 and process p1 is not interested to enter into critical section but p2 want to enter critical section. P2 is not able to enter critical section in this as only when p1 finishes execution, then only p2 can enter (then only s1 = s2 condition be satisfied). Progress will not be satisfied when any process which is not interested to enter into the critical section will not allow other interested process to enter into the critical section.

Information about Test: Process Synchronization- 2 Page
In this test you can find the Exam questions for Test: Process Synchronization- 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Process Synchronization- 2, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)