Operating systems exams - multiple choice questions (MCQ) and answers
Operating
Systems MCQ questions and answers – Set 12
1. Which of the following is not a solution to the critical-section problem?
(a) Conditional critical
region
(b) Shared memory
(c) Monitor
(d) Semaphore
View Answer
Answer: (b) Shared
memory
The
critical section problem refers to the problem of how to ensure that at most
one process is executing its critical section at a given time.
|
2. What is the purpose of multiprogramming?
(a) Utilize CPU better
(b) Make the computer
hardware more user friendly
(c) Make it easy for the users
to run programs
(d) To get the most out of
slow input-output devices
View Answer
Answer: (a) Utilize CPU
better
Increased CPU utilization is one of the advantages of
multiprogramming. Multiprogramming improves CPU
utilization as it organizes a number of jobs where CPU always has one to
execute.
Other advantages of multi-programming are;
Increased
throughput, shorter turnaround time, improved memory utilization, increased
resources utilization and multiple users.
|
3. Which scheduling algorithm can avoid deadlock?
(a) Round Robin algorithm
(b) Rollback algorithm
(c) Banker’s algorithm
(d) None of the above
View Answer
Answer: (c) Banker’s
algorithm
The
concept of deadlock avoidance is to prevent deadlocks from happening. It is
achieved by preventing at least one of the necessary conditions of deadlock
from happening.
This
algorithm handles multiple instances of the same resource. It forces threads
to provide advance information about what resources they may need for the
duration of the execution. As per this algorithm, the resources requested may
not exceed the total available in the system. The algorithm allocates
resources to a requesting thread if the allocation leaves the system in a
safe state. Otherwise, the thread must wait.
|
4. Which of the following components of program state are shared across threads in a multithreaded process?
(a) Register values
(b) Heap memory
(c) Global variables
(d) Stack memory
View Answer
Answer: (b) Heap memory
and (c) Global variables
Heap
memory is the dynamic memory allocation. Global variables are available to
all functions within a program. They are accessible anywhere in the program.
Threads
share the heap and global variables. They have private register values and
private stack segments.
|
5. Which of the following scheduling
algorithms could result in starvation?
(a) First-come,
first-served
(b) Shortest job first
(c) Round robin
(d) Priority
View Answer
Answer: (b) Shortest Job
First and (d) Priority scheduling
Shortest Job First and Priority based scheduling algorithms may result in starvation.
In Shortest Job First scheduling algorithm the larger processes will have
more waiting time, hence they may starve. In priority based scheduling a
process which is ready may be starved if more high priority processes are
executed by CPU.
|
*********
No comments:
Post a Comment