• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

OS Process Management

Question 41

If the time-slice used in the round-robin scheduling policy is more than the maximum time required to execute any process, then the policy will
  • degenerate to shortest job first
  • degenerate to priority scheduling
  • degenerate to first come first serve
  • none of the above

Question 42

Consider the following C code for process P1 and P2. a=4, b=0, c=0 (initialization)
     P1                      P2
  if (a < 0)                b = 10;    
    c = b-a;                a = -3;
  else
    c = b+a;

If the processes P1 and P2 executes concurrently (shared variables a, b and c), which of the following cannot be the value of ‘c’ after both processes complete?
  • 4
  • 7
  • 10
  • 13

Question 43

Which of the following actions is/are typically not performed by the operating system when switching context from process A to process B?
  • Saving current register values and restoring saved register values for process B.
  • Changing address translation tables.
  • Swapping out the memory image of process A to the disk.
  • Invalidating the translation look-aside buffer.

Question 44

In a computer system where the \'best-fit\' algorithm is used for allocating \'jobs\' to \'memory partitions\', the following situation was encountered: tabkle When will the 20K job complete? Note - This question was subjective type.
  • 8
  • 18
  • 11
  • None of these

Question 45

A concurrent system consists of 3 processes using a shared resource R in a non-preemptible and mutually exclusive manner. The processes have unique priorities in the range 1.....3, 3 being the highest priority. It is required to synchronize the processes such that the resource is always allocated to the highest priority requester. The pseudo code for the system is as follows.
Shared Data
mutex:semaphore = 1:/* initialized to 1*/
process[3]:semaphore = 0; /*all initialized to 0 */
R_requested [3]:boolean = false; /*all initialized to false */
busy: boolean = false; /*initialized to false */

Code for processes
begin process
my-priority:integer;
my-priority:=____; /*in the range 1...3*/
repeat
    request_R(my-priority);
    P (proceed [my-priority]);
    {use shared resource R}
    release_R (my-priority);
forever
end process;

Procedures
procedure request_R(priority);
P(mutex);
if busy = true then
    R_requested [priority]:=true;
else
 begin
    V(proceed [priority]);
    busy:=true;
 end
V(mutex);

Give the pseudo code for the procedure release_R.

    Question 46

    The process state transition diagram in below figure is representative of "Untitled                
    • a batch operating system
    • an operating system with a preemptive schedular
    • an operating system with a non-preemptive schedular
    • a uni-programmed operating system

    Question 47

    Which of the following option is False?
    • An executing instance of a program is called a process while a thread is a subset of the process.
    • Threads have considerable overhead while processes have almost no overhead.
    • Execution of processes are independent while execution of threads are dependent.
    • New processes require duplication of the parent process while new threads are easily created.

    Question 48

    Which of the following is/are not shared by all the threads in a process?
    I. Program Counter
    
    II. Stack
    
    III. Registers
    
    IV. Address space
    
    • I and II only
    • II and III only
    • I, II and III only
    • IV only

    Question 49

    Consider the set of processes with arrival time(in milliseconds), CPU burst time (in milliseconds), and priority(0 is the highest priority) shown below. None of the processes have I/O burst time. g2017_12 The waiting time (in milliseconds) of process P1 using preemptive priority scheduling algorithm is ____.
    • 26
    • 49
    • 38
    • 29

    Question 50

    The following are some events that occur after a device controller issues an interrupt while process L is under execution. (P) The processor pushes the process status of L onto the control stack. (Q) The processor finishes the execution of the current instruction. (R) The processor executes the interrupt service routine. (S) The processor pops the process status of L from the control stack. (T) The processor loads the new PC value based on the interrupt. Which of the following is the correct order in the which the events above occur?
    • QPTRS
    • PTRSQ
    • TRPQS
    • QTPRS
    1

    ...

    456

    ...

    12

    There are 115 questions to complete.

    Last Updated :
    Take a part in the ongoing discussion