Tuesday, April 7, 2020

MCQ in operating systems with answers

MCQ in operating systems with answers, OS interview questions, solved Gate questions in OS


Operating Systems Multiple Choice Questions - Set 7



1. Which of the following is a disadvantage of user level threads?

(a) User-level thread does not require modification to operating systems.
(b) Thread switching is not expensive than a procedure call.
(c) User-level threads can be implemented on a OS that does not support threads.
(d) User level threads require non blocking system calls
Answer: (d)
User-level threads require non-blocking systems call i.e., a multithreaded kernel. Otherwise, entire process will blocked in the kernel, even if there are runnable threads left in the processes. For example, if one thread causes a page fault, the process blocks.
 
2. What is normally meant by a “context switch”?

(a) Any change in state of a process as it executes.
(b) Saving the state of one process and restoring the state of another process so that the CPU moves from running one process to running the other.
(c) The switch between a process running in user mode to running in kernel mode. This can happen as the result of a system call or an exception.
(d) The change which occurs on the stack of a running process as it makes a function call, including the allocation of memory for any parameters and the local variables.
Answer: (b)
The change from one process running to another one running on the same processor is usually referred to as a "context switch".

3. Given three processes A, B, and C with corresponding burst times 20, 5, and 2, what is the average waiting time with a first come first served (FCFS) scheduler? All processes are ready to run at the same time but they arrived in the order A, B, then C.

(a) 3
(b) 15
(c) 9
(d) 25
Answer: (b)
The Gantt chart for the given schedule is;
          A      
B  
C
   0                                  20         25      27
Average waiting time = (0+20+25)/3 = 15.

4. Which of the following is NOT an advantage of system-level threads over user-level threads?

(a) Threads from the same process can run simultaneously on different cores/processors
(b) Each thread can be scheduled separately
(c) Switching between threads is faster
(d) Blocking threads don’t stop the entire process
Answer: (c)
User-level threads are easier and faster to create than kernel-level threads. They can also be more easily managed.

5. The definition “an instance of a program in execution” best applies to which of the following?

(a) a thread
(b) a process
(c) a system-level resource
(d) a user-level resource

Answer: (b)
A process is an instance of a program in execution. An active program can be called a Process. Process contains the program code and its activity.

****************
Go to Operating Systems MCQ home page

Go to Operating Systems home page


Go to Operating Systems TRUE/FALSE questions page




Define process in OS

Advantages of user level threads

Solved GATE exam questions in operating systems

Solved exercise in FFCS scheduling

What is context switch

Multiple choice questions with answers in operating systems

OS MCQ with answers explained


No comments:

Post a Comment

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery