If a system is not in a safe state, there can be No deadlocks.
►True
►False(Page 137)
A dashed line is used to represent a _________ in Resource Allocation Graph.
►Claim edge (Page 138)
►Request edge
►Assignment edge
►Allocation edge
The process of holding at least one resource and waiting to acquire additional resources that are currently
being held by other processes is known as________.
►Mutual exclusion
►Hold and wait (Page 131)
►No preemption
►Circular wait
In Resource Allocation Graph, A _______ Pi →Rj indicates that process Pi may request resource Rj at some
time in the future.
►Claim edge (Page 138)
►Request edge
►Assignment edge
►Allocation edge
If the system can allocate resources to each process in some order and still avoid a deadlock then it said to
be in ______ state.
►Safe (Page 137)
►Unsafe
►Mutual
►Starvation
A condition where a set of blocked processes each holding a resource and waiting to acquire a resource
held by another process in the set is termed as ________.
►Deadlock (Page 130)
►Starvation
The following is NOT a classical problem of synchronization
►Bounded buffer problem
►Reader writer problem
►Dining philosopher‟s problem
►Counting semaphore problem (Page 118)
(MCQZ-CS604 Operating Systems)
(No repeated Questions) April 2014
(MCS Students: MC120202589/MC120201756)
Virtual University Of Pakistan
[email protected], [email protected]
The integer value of ________semaphores can range over an unrestricted integer domain.
►Counting (Page 117)
►Binary
►Mutex
►Bounded buffer
The condition in which a set {P0, P1… Pn} of waiting processes must exist such that P0 is waiting for a
resource that is held by P1, P1 is waiting for a resource that is held by P2, and so on, Pn-1 is waiting for a
resource held by Pn, and Pn is waiting for a resource held by P0. This condition is known as
______________.
►Mutual exclusion
►Hold and wait
►No preemption
►Circular wait (Page 131)
You can use the rm file1 command to __________ file1
►Retrieve
►Remove (Page 30)
►Make
►modify
The correct command for compiling C program named program.c in Linux environment is
►gcc program.c -o FirstPrgram (Page 31)
►gcc -o FirstProgram program.c
►gcc -z FirstProgram program.c
►gcc program.c -m FirstPrgram
Using _________system, we can create a new process in Linux.
►Fork (Page 39)
► exec
►wait
►exit
Cooperating processes never share any data, code, memory or state.
►True
►False(Page 5)
Question No: 5 of 10 ( Marks: 1 ) - Please choose one
____ command display the status of a process.
►ls
►ps (Page 66)
►gcc
►cat
Swapper is also termed as Short term scheduler.
►True
►False(Page 36)
_____ system call is used to write to a file or FIFO or any other IPC channel.
►read
►write(Page 48)
►open
►fork
A Process „A‟ that has finished working but its parent process has also finished its execution. In this
state the process „A‟ will be called as _____ process.
►Child
►Thread
►Zombie (Page 42)
►Fork
_________________ scheduling allows a process to move between queues.
►Round Robin
►First Come First Serve
►Multilevel Feedback Queue (Page 92)
►Shortest Remaining Time First
Kernel is responsible for scheduling the user level threads.
►True
►False (Page 73)
A ---------------- (or an exception) is a software-generated interrupt caused either by an error (division by
zero or invalid memory access) or by a user request for an operating system service.
► Interrupt
► Trap (Page 10)
► Signal
► Process
Which register holds the smallest legal physical memory address for a process?
► Base register (Page 13)
► Limit register
► Status register
► None of the given options
The --------------semaphore provides mutual exclusion for accesses to the buffer pool and is initialized to
the value 1.
► mutex (Page 118)
► binary
► couting
► none of the given options
Binary semaphores are those that have only two values---------
► 0 and n
► 0 and 0
► 0 and 1 (Page 117)
► None of the given options
Physical memory is broken down into fixed-sized blocks, called----------- and Logical memory is divided
into blocks of the same size, called -----------
► Frames, pages (Page 165)
► Pages, Frames
► Frames, holes
► Holes, segments
A page table needed for keeping track of pages of the page table is called --------------
► 2-level paging
► Page directory (Page 173)
► Page size
► Page table size
The address generated by the CPU, after any indexing or other addressing-mode arithmetic, is called a —
-----address, and the address it gets translated to by the MMU is called a ---------address.
►Virtual, physical click here for detail
► Hexadecimal, Binary,
► Valid, invalid
► Physical, Virtual
Each page is a power of -------- bytes long in paging scheme.
► 2
► 3
► 4 (Page 167)
► 5
Which part of the computer system helps in managing the file and memory management system?
► Operating System (Page 5)
► Device Drivers
► Application Software
► Hardware
Which of the following is correct definition for wait operation?
► wait(S) { (Page 111)
while(S<=0)
;// no o
S–;
}
► wait(S) {
S++;
}
► wait(S) {
while(S>=0)
;// no op
S–;
}
► wait(S) {
S–;
}
In deadlock detection and recovery algorithm, a deadlock exists in the system if and only if the wait for
graph contains a _____________
► Cycle (Page 147)
► Graph
► Edge
► Node
------------ register contains the size of the process
►Base register
►Index register
►Limit register (Page 13)
►Stack pointers register
The -----------scheme is not applicable to a resource allocation system with multiple instances of each
resource type.
►Wait for graph (Page 148)
►Resource allocation graph
►Both Resource-allocation and wait-for graph ► None of the given options
___________ algorithm is used in Deadlock avoidance.
►Bakery
►Banker‟s (Page 139)
►Mutual exclusion
►Safe Sequence
What do we name to an address that is loaded into the memory-address register of the memory?
►Logical address
►Physical address (Page 155)
►Binary addresses
►None of the given options
Cache is non-volatile memory.
►True
►False (Page 153)
A system call________
►Is an entry point into the kernel code (Page 18)
►Allows a program to request a kernel service
►Is a technique to protect I/O devices and other system resources
►All of the these
The condition where a set of blocked processes each holding a resource and waiting to acquire a resource
held by another process in the set, is termed as ________.
►Deadlock (Page 130)
►Starvation
Banker‟s algorithm is used for ________________
►Deadlock avoidance (Page 140)
►Deadlock detection
►Deadlock prevention
►Deadlock removal
The ________ requires that once a writer is ready, that writer performs its write as soon as possible , if a
writer waiting to access the object, no new readers may start reading.
first readers-writers problem
►second readers-writers problem (Page 119)
►third readers-writers problem
►fourth readers-writers problem
________________ is an integer variable accessible through wait and signal which are atomic operations.
►Semaphore (Page 111)
►Mutex
►Busy w aiting
►Signal
The integer value of _________ semaphores can not be greater than 1.
►Counting
►Binary (Page 117)
►Mutex
►Bounded buffer
Starvation is infinite blocking caused due to unavailability of resources.
►True (Page 115)
►False
Operating System provides services such as Managing Primary and Secondary Storage, Processes and
Allowing user to manage his/her files and directories.
►True (Page 5)
►False
___________ is used in real time operating systems.
►Non-preemptive scheduling Click here for detail
►Preemptive scheduling
►Dispatching scheduling
►FCFS scheduling
Preventing a condition of ________ to happen, deadlocks can be prevented to happen.
►Critical region
►Circular wait (Page 136)
►Monitors
►Critical section
The problem with priority scheduling algorithm is ________.
Deadlock
Starvation (Page# 84)
Aging
Nice value
Kernel threads are supported directly by the operating system. The kernel performs
the scheduling, creation, and management in ------ command display the status of a
process.
ls
ps (Page# 63)
gcc
cat
_______________ scheduling algorithm can be preemptive or non-preemptive.
First Come First Serve
Shortest Job First (Page # 83)
Round Robin
Priority
Round Robin algorithm is most suitable for __________.
Time sharing system (Page # 86)
Real time systems and batch systems
Running Batch programs
Expert system
The critical section problem can‟t be solved by the following except
Software based solution
Firmware based solution (Page# 99)
Operating system based solution
Hardware based solution
Mkfifo () is a _______.
System Call
Command
Directory
None of Above (Page# 57)
Preemptive ----------------scheduling is sometimes called shortest remaining-time-first scheduling.
First-Come-First-Served (FCFS)
Round-Robin
Sorted Job First (SJF) (Page# 83)
Priority
rm and rmkdir commands are used to _____________ directory.
Create
Move
Remove(Page# 27)
Modify
Linux is only single user operating system
True
False (Page# 4)
____________ command is used to change the directory.
Ls
Cp
Cd (Page# 23)
mv
______________ is used to request the OS by the process to take an I/O or initiating child process.
System call
Interrupt
Trap
Signal
A parent process calling __________ system call will be suspended until children process terminates.
Select correct option:
wait
fork
exit
exec
In producer-Consumer problem synchronization is required. On which shared area this
synchronization actually affect?
Counter
Buffer (Page #45)
Entry section
Exit section
Which could not be the advantage of thread?
Separate address space
Quick response
Economical
Best in multiprocessing environment
Using hardware solution to synchronization for complex problems, introduce a new
synchronization tool know as _______________.
TestAndSet
Semaphore (Page No. 111 )
Swap
Trap
In instruction TestAndSet mutual exclusion implementation is done by declaring a Boolean
variable lock ______________.
Initialized as zero
Initialized as true
Initialized as 1
Initialized as false (Page No. 109)
Use of semaphore create a problem of busy waiting, this wastes CPU cycles that some other
process may be able to use productively. This type of semaphore is also called ______________
Semaphore S
Spinlock (Page No. 112 )
Locking Semaphore
Mutex
------------- is a segment of code that accesses a shared resource like data structure or device
that must not be concurrently accessed by more than one thread of execution.
Multithreading
Context switching
Critical section (Page No. 105, click here for details )
Pipelining
Critical section is a place where certain shared structure is updated. Its solution required
certain precaution; one of them is the access to critical section by one process at a time only.
What this condition is termed as?
Progress
Entry section
Bounded waiting
Mutual exclusion
A solution to the critical section problem must satisfy the following requirements except
Progress
Mutual Exclusion
Bounded Waiting
Race Condition
Keep in mind scheduling algorithm, when you go to any famous fast food franchise .On
entering the store, each customer receives a number. The customer with the lowest number is
served next. This algorithm is called-------------.
Dijkastra algorithm
Simple algorithm
Deadlock algorithm
Bakery algorithm
While executing the statement c++/c-- in Producer-Consumer problem, at back end certain
number of instructions are executed, if interleaving of statements happen, it create race
condition. Tell number of instructions that require “no interleaving” while executing c++/c–?
3
1
2
0
User mode can run the Privileged instructions.
Select correct option:
True
False
In Unix/Linux environment, Ayesha wants to know the complete picture of current processes
in her session. Which of the following command will help her in this regard?
Select correct option:
$ ps
$ gcc
$ top
$ fifo
When processes are generated using fork () system call and then after that they are
coordinated with each other using IPC channel. They are utilizing a separate address space for
each of process (parent, child), kernel resources and IPC channel. This makes it a more heavy.
Which strategy can be used to make it light?
Select correct option:
Termination of child process when these become more
Scheduling of each process
Use of threads
Use of Batch systems
In process management, some of the jobs can be suspended for some time in order to give other
jobs a chance to be in execution. Which command can be used to place back a suspended
program?
Select correct option:
Fg
Top
Ps
Bg
When sender never block because it has an infinite length storage area, then it means it is
holding a queue of _____________ capacity.
Select correct option:
Zero
Unbounded
Defined
Bounded
In system call that creates a pipe for IPC. If one of the operation from read/write would fail
then what will be returned as result?
Select correct option:
-1,+1
-1 (page 57)
1
0
To terminate a process <ctrl-c> is pressed, which signal it actually pass to process for
termination?
Select correct option:
SIGTERM
SIGINT
SIGKILL
SIGTRAP
A Process „A‟ that has finished working but its parent process has also finished its execution.
In this state the process „A‟ will be called as _____ process.
Select correct option:
Child
Thread
Zombie
Fork
While using the read/write system call which data type is use to return the size of file to buffer
from file descriptor fd?
Select correct option:
Pipefd
SIZE_MAX
FIFO
Ssize_t (page45)
In Unix/Linux ------------- are used for client server communication to pass data between a
server process and client processes.
Select correct option:
FIFO (page 60)
LIFO
Read()
Write()
Consider a scenario of CPU protection, ----------- is added to the operating system in order to
detect and avoid loop in a user program.
Select correct option:
I/O
Timer
Base and limit registers
Turning interrupt enable off
Thread that is not executed for servicing a request by a user thread .It is named as -------------.
EINVAL
EAGAIN
LWP
POSIX
Consider three processes in scheduling. Here are the waiting times for three processes
P1=4,P2=2,P3=6.Which one of is correct average waiting time per process?
4 (page 81)
6
2
3
In Unix/Linux environment Ali want to know the number of processes running on the system and their
status, number of CPUs in the system and their usage, amount of main memory and its usage. Which of
the following command will help in this regard?
$ ps
$ gcc
$ fifo
$ top
In multi-threaded process thread () take two argument, they are used to take______________
and ___________.
Program counter value, address space limit
New thread ID, process name
Register count, program counter
New thread function name, new thread ID
Pipes simply used on the command line to connect the standard input of one process to the
standard input of another. Which of the following syntax is correct use of command line Linux
/UNIX pipes?
Select correct option:
cmd1 % cmd2% ……… %cmdN
cmd1 | cmd2 | … | cmdN (page 53)
cmd1 $ cmd2 $ …………… $ cmdN
cmd1 & cmd2 & ……………&cmdN
__________ commands in Linux helps to create a new directory.
Select correct option:
ls
cp
mv
mkdir
When processes communicate with each other, they perform communication through
synchronization and utilizing separate address spaces. This action is termed as
Select correct option:
Inter-process communication (page 67)
Process management
Synchronization
Direct/indirect communication
Ali is an operating system designer. One user requirement regarding OS is easy to debug and
modify. In your opinion which one of the following OS structure Ali needs to follow?
Select correct option:
Simple OS Approach
Micro kernels
Layered Approach
Virtual Machines
Given bellow two statements can be categorized in some sort of message passing techniques.
This type is named as ____________.
• Send (A, message) • Receive (B, message)
Synchronization
Direct communication
Explicit buffering
Send by copy communication
The TSL (TestAndSet instruction) which is the hardware solution to synchronization problem does
not satisfy the ________ condition, hence not considered to be a good solution.
Bounded waiting P/106
None
Mutual exclusion
Progress
The ------------system call is used to open or create a file.
Open () Google
Read ()
Write ()
Close ()
------------- Threads are implemented by a thread library.
Kernel thread
User thread pg 70
In client-server applications, __________ are used to pass data between a server process and client
processes.
FIFOs
Used by __________ commands o pass data from one shell pipeline to another, without creating
temporary files.
Shell
Fork system call is zero for the __________ process.
Child
__________ that define the ways in which system resources are used to solve the computing
problems of the users.
Applications programs
__________ is used to create a thread.
Thread ()
Which multi-threading models provides true concurrency __________ .
One-to-one
User level provided support for __________ .
User threads
In critical section problem each process must first request permission to enter its critical section,
the section of code implementing this request is called the __________ .
Entry section
2-Process and n-Process solutions to the Critical Section Problem are software solutions.
Software
Command Name interpreter is often known as the _______.
a. Register
b. Shell
c. Kernel
d. Timer
All jobs that enter into a ________system are kept in the job pool.
a. Single user.
b. Batch
c. Multiprogrammed
d. Time sharing system
Using _____ system call, we can create a new process in Unix.
a. Fork
b. Exec
c. Wait
d. Exit
Pipe system call is used to _________ a pipe.
a. Destroy
b. Create
c. Modify
d. Clear
To avoid race condition, the number of processes that may be simultaneously inside the critical
section is ___________.
a. 8
b. 1
c. 16
d. 0
A time interval when a process uses CPU only is called ______________.
a. Scheduling
b. I/O burst
c. CPU burst
d. Dispatch latency
The solution type where in critical section we use “entry section and “exit section” is called kind of
_______________.
Select correct option:
Hardware Solution
Assumption
Software Solution
Consider three processes in scheduling .Here are the waiting times for the three processes P1 = 5;
P2 = 10; P3 = 3. Which one of the following is correct average waiting time per process?
Select correct option:
3
2
18
6
Critical section problem can be solved by using how many ways?
Select correct option:
4
3 (page 101)
1
2
The section of code before the critical section is called __________
Select correct option:
Entry section
Remainder section
Exit section
Crystal section
The section of code after the critical section is called __________.
Select correct option:
Crystal section
Entry section
Remainder section
Exit section
_____________ algorithm is used for solving n-process critical section problem.
Select correct option:
Bankers
Bakery (page 105)
Babbles
None of the given
Consider a system of N processes (Po, P1 …… Pn-1). Each process in its critical section and the
process may be changing common variables, updating a table, writing a file etc. No other process is
allowed to execute in its critical section. This problem is called -------------
Select correct option:
Bakery algorithm
N-Mutual exclusion
N-Process Critical Section (page 105)
Deadlock algorithm
Consider three processes in scheduling .Here are the waiting times for the three processes P1 = 4;
P2 = 2; P3 = 6. Which one of the following is correct average waiting time per process?
Select correct option:
4
6
2
3
Clock interrupt handler is an example of kernel thread that is not executed for servicing by user
thread. It is named as
EInval
EAGAIN
LWP (I think)
PoSIX
Thanks for Sharing
(MCQs- Solved- CS604 Operating Systems)
(No repeated Questions) April 2014
(MCS Students: MC120202589/MC120201756)
Virtual University Of Pakistan
[email protected], [email protected]