0% found this document useful (0 votes)
28 views15 pages

OS PreTest2 Answer

Uploaded by

bopiranha2011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views15 pages

OS PreTest2 Answer

Uploaded by

bopiranha2011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

.

A deadlock avoidance algorithm dynamically examines the __________ to


ensure that a circular wait condition can never exist.
Select one:
resource allocation state
operating system
system storage state
resources
.A situation where several processes access and manipulate the same data
concurrently and the outcome of the execution depends on the particular
order in which access takes place is called ____________
Select one:
starvation
race condition
data consistency
aging
Given a priori information about the ________ number of resources of each
type that maybe requested for each process, it is possible to construct an
algorithm that ensures that the system will never enter a deadlock state.
Select one:
approximate
average
maximum
minimum
.The signal operation of the semaphore basically works on the basic _______
system call.
Select one:
wakeup()
start()
getup()
continue()
With _____________ only one process can execute at a time; meanwhile all
other process are waiting for the processor. With ______________ more than
one process can be running simultaneously each on a different processor.
Select one:
Multiprogramming, Uniprocessing
Multiprocessing, Multiprogramming
Uniprogramming, Multiprocessing
Multiprogramming, Multiprocessing
The child process completes execution, but the parent keeps executing,
then the child process is known as __________
Select one:
Body
Dead
Orphan
Zombie

What is the disadvantage of invoking the detection algorithm for every


request?
Select one:
excessive time consumed in the request to be allocated memory
considerable overhead in computation time
all of the mentioned
overhead of the detection algorithm due to consumption of memory
Which process can be affected by other processes executing in the system?
Select one:
cooperating process
init process
parent process
child process
The disadvantage of a process being allocated all its resources before
beginning its execution is ____________
Select one:
Very high resource utilization
Low resource utilization
None of the mentioned
Low CPU utilization
What is the drawback of banker’s algorithm?
Select one:
in advance processes rarely know how much resource they will need
all of the mentioned
resource once available can disappear
the number of processes changes as time progresses
A semaphore is a shared integer variable __________
Select one:
that can not be more than one
that can not drop below zero
that can not be more than zero
that can not drop below one
What are Multithreaded programs?
Select one:
none of the mentioned
not at all prone to deadlocks
lesser prone to deadlocks
more prone to deadlocks
.An edge from process Pi to Pj in a wait for graph indicates that ____________
Select one:
Pi is waiting for Pj to release a resource that Pi needs
Pi is waiting for Pj to leave the system
Pj is waiting for Pi to leave the system
Pj is waiting for Pi to release a resource that Pj needs
A problem encountered in multitasking when a process is perpetually
denied necessary resources is called ____________
Select one:
inversion
starvation
aging
deadlock
.To _______ to a safe state, the system needs to keep more information
about the states of processes.
Select one:
queue the process
roll back the process
abort the process
none of the mentioned
.In the bakery algorithm to solve the critical section problem ____________
Select one:
each process is put into a queue and picked up in an ordered manner
each process gets a unique number and the one with the highest number is served
next
each process gets a unique number and the one with the lowest number is served
next
each process receives a number (may or may not be unique) and the one with the
lowest number is served next
For sharable resources, mutual exclusion ____________
Select one:
is not required
is required
may be or may not be required
none of the mentioned
.In UNIX, the return value for the fork system call is _____ for the child
process and _____ for the parent process.
Select one:
A nonzero integer, Zero
Zero, A nonzero integer
Zero, A Negative integer
A Negative integer, Zero
A monitor is a module that encapsulates __________
Select one:
synchronization between concurrent procedure invocation
shared data structures
all of the mentioned
procedures that operate on shared data structure
A state is safe, if ____________
Select one:
the system can allocate resources to each process in some order and still avoid a
deadlock
the system does not crash due to deadlock occurrence
all of the mentioned
the state keeps the system protected and safe
Deadlock prevention is a set of methods ____________
Select one:
to ensure that at least one of the necessary conditions cannot hold
to recover from a deadlock
to ensure that all of the necessary conditions do not hold
to decide if the requested resources for a process have to be given or not
In UNIX, each process is identified by its __________
Select one:
Process Identifier
Device Queue
None of the mentioned
Process Control Block
The resource allocation graph is not applicable to a resource allocation
system ____________
Select one:
with multiple instances of each resource type
single & multiple instances of each resource type
with a single instance of each resource type
none of the mentioned
The process to be aborted is chosen on the basis of the following factors?
Select one:
how long the process has computed
priority of the process
all of the mentioned
process is interactive or batch
A monitor is characterized by ____________
Select one:
the number of variables in it
a set of programmer defined operators
an identifier
all of the mentioned
The data structures available in the Banker’s algorithm are ____________
Select one:
All of the mentioned
Allocation
Need
Available
Concurrent access to shared data may result in ____________
Select one:
data consistency
none of the mentioned
data inconsistency
data insecurity
Which of the following conditions must be satisfied to solve the critical
section problem?
Select one:
Bounded Waiting
Progress
All of the mentioned
Mutual Exclusion
.Which one of the following is a visual ( mathematical ) way to determine
the deadlock occurrence?
Select one:
none of the mentioned
inversion graph
starvation graph
resource allocation graph
Cascading termination refers to termination of all child processes if the
parent process terminates ______
Select one:
Normally
Normally or abnormally
None of the mentioned
Abnormally
A computer system has 6 tape drives, with ‘n’ processes competing for
them. Each process may need 3 tape drives. The maximum value of ‘n’ for
which the system is guaranteed to be deadlock free is?
Select one:
3
1
4
2
Each request requires that the system consider the _____________ to decide
whether the current request can be satisfied or must wait to avoid a future
possible deadlock.
Select one:
processes that have previously been in the system
resources currently available
resources currently allocated to each process
future requests and releases of each process
The child process can __________
Select one:
be a duplicate of the parent process
never have another program loaded into it
never be a duplicate of the parent process
cannot have another program loaded into it
A parent process calling _____ system call will be suspended until children
processes terminate.
Select one:
fork
wait
exit
exec
When several processes access the same data concurrently and the
outcome of the execution depends on the particular order in which the
access takes place is called ________
Select one:
dynamic condition
essential condition
race condition
critical condition
Restricting the child process to a subset of the parent’s resources prevents
any process from __________
Select one:
overloading the system by using a lot of secondary storage
under-loading the system by very less CPU utilization
overloading the system by creating a lot of sub-processes
crashing the system by utilizing multiple resources
What are the operations that can be invoked on a condition variable?
Select one:
hold & wait
wait & signal
signal & hold
continue & signal
All unsafe states are ____________
Select one:
none of the mentioned
deadlocks
fatal
not deadlocks
For Mutual exclusion to prevail in the system ____________
Select one:
at least one resource must be held in a non sharable mode
there must be at least one resource in a sharable mode
the processor must be a uniprocessor rather than a multiprocessor
all of the mentioned
The request and release of resources are ___________
Select one:
command line statements
special programs
interrupts
system calls
If a process is executing in its critical section, then no other processes can
be executing in their critical section. What is this condition called?
Select one:
asynchronous exclusion
mutual exclusion
critical exclusion
synchronous exclusion
Mutual exclusion can be provided by the __________
Select one:
binary semaphores
mutex locks
both mutex locks and binary semaphores
none of the mentioned
A deadlock can be broken by ____________
Select one:
abort all the process in the system
none of the mentioned
preempt all resources from all processes
abort one or more processes to break the circular wait
If deadlocks occur frequently, the detection algorithm must be invoked
________
Select one:
rarely
rarely & frequently
none of the mentioned
frequently
What is a reusable resource?
Select one:
that can be used by one process at a time and is not depleted by that use
that can be used by more than one process at a time
none of the mentioned
that can be shared between various threads
.The number of resources requested by a process ____________
Select one:
must always be less than the total number of resources available in the system
must exceed the total number of resources available in the system
must not exceed the total number of resources available in the system
must always be equal to the total number of resources available in the system
For a deadlock to arise, which of the following conditions must hold
simultaneously?
Select one:
Hold and wait
All of the mentioned
No preemption
Mutual exclusion
.A system has 3 processes sharing 4 resources. If each process needs a
maximum of 2 units then, deadlock ____________
Select one:
has to occur
none of the mentioned
can never occur
may occur

.Cost factors for process termination include ____________


Select one:
Number of resources the deadlock process is not holding
All of the mentioned
CPU utilization at the time of deadlock
Amount of time a deadlocked process has thus far consumed during its execution
.If no cycle exists in the resource allocation graph ____________
Select one:
then the system will not be in a safe state
then the system will be in a safe state
none of the mentioned
all of the mentioned
Semaphore is a/an _______ to solve the critical section problem.
Select one:
hardware for a system
integer variable
none of the mentioned
special program for a system
The circular wait condition can be prevented by ____________
Select one:
using thread
all of the mentioned
defining a linear ordering of resource types
using pipes
.For an effective operating system, when to check for deadlock?
Select one:
none of the mentioned
every time a resource request is made at fixed time intervals
at fixed time intervals
every time a resource request is made
.What is the main disadvantage of spinlocks?
Select one:
they are too complex for programmers
they are not sufficient for many process
they require busy waiting
they are unreliable sometimes
The segment of code in which the process may change common variables,
update tables, write into files is known as ____________
Select one:
program
non – critical section
synchronizing
critical section
.To ensure no preemption, if a process is holding some resources and
requests another resource that cannot be immediately allocated to it
____________
Select one:
then the process waits for the resources be allocated to it
the process keeps sending requests until the resource is allocated to it
then all resources currently being held are preempted
the process resumes execution without the resource being allocated to it
For non sharable resources like a printer, mutual exclusion ____________
Select one:
none of the mentioned
must not exist
may exist
must exist
.A system is in a safe state only if there exists a ____________
Select one:
safe allocation
all of the mentioned
safe resource
safe sequence
.Process synchronization can be done on __________
Select one:
software level
both hardware and software level
none of the mentioned
hardware level
.For a Hold and wait condition to prevail ____________
Select one:
A process must hold at least one resource and not be waiting to acquire additional
resources
None of the mentioned
A process must be holding at least one resource and waiting to acquire additional
resources that are being held by other processes
A process must be not be holding a resource, but waiting for one to be freed, and
then request to acquire it
.The two ways of aborting processes and eliminating deadlocks are
____________
Select one:
Abort all deadlocked processes
Abort all processes
Abort one process at a time until the deadlock cycle is eliminated
All of the mentioned
.A procedure defined within a ________ can access only those variables
declared locally within the _______ and its formal parameters.
Select one:
semaphore, semaphore
process, monitor
process, semaphore
monitor, monitor
.When high priority task is indirectly preempted by medium priority task
effectively inverting the relative priority of the two tasks, the scenario is
called __________
Select one:
priority modification
priority removal
priority exchange
priority inversion
Which one of the following is a synchronization tool?
Select one:
socket
thread
semaphore
pipe
.Mutual exclusion implies that ____________
Select one:
if a process is executing in its critical section, then all the resources of the system
must be blocked until it finishes execution
if a process is executing in its critical section, then other processes must be
executing in their critical sections
if a process is executing in its critical section, then no other process must be
executing in their critical sections
none of the mentioned
.The content of the matrix Need is ____________
Select one:
Allocation – Available
Max – Available
Allocation – Max
Max – Allocation
.A deadlock eventually cripples system throughput and will cause the CPU
utilization to ______
Select one:
none of the mentioned
drop
stay still
increase
.The wait-for graph is a deadlock detection algorithm that is applicable
when ____________
Select one:
all resources have a single instance
all resources have a single 7 multiple instances
all resources have multiple instances
all of the mentioned
.What is the solution to starvation?
Select one:
resource preemption be done instead
the number of resources must be included in resource preemption
all of the mentioned
the number of rollbacks must be included in the cost factor
.If the resources are always preempted from the same process __________
can occur.
Select one:
system crash
deadlock
aging
starvation
.An un-interruptible unit is known as ____________
Select one:
static
single
none of the mentioned
atomic
.A minimum of _____ variable(s) is/are required to be shared between
processes to solve the critical section problem.
Select one:
four
two
three
one
.If the wait for graph contains a cycle ____________
Select one:
then a deadlock exists
then the system is in a safe state
then a deadlock does not exist
either deadlock exists or system is in a safe state
.Those processes should be aborted on occurrence of a deadlock, the
termination of which?
Select one:
incurs minimum cost
safety is not hampered
all of the mentioned
is more time consuming
.Which of the following condition is required for a deadlock to be possible?
Select one:
all of the mentioned
mutual exclusion
a process may hold allocated resources while awaiting assignment of other
resources
no resource can be forcibly removed from a process holding it
.Which is the process of invoking the wait operation?
Select one:
waiting for another process to complete before it can itself call the signal operation
suspended until another process invokes the signal operation
none of the mentioned
stopped until the next process in the queue finishes execution
.Which one of the following is the deadlock avoidance algorithm?
Select one:
banker’s algorithm
elevator algorithm
karn’s algorithm
round-robin algorithm
.The code that changes the value of the semaphore is ____________
Select one:
non – critical section code
remainder section code
critical section code
none of the mentioned
.A monitor is a type of ____________
Select one:
high level synchronization construct
semaphore
none of the mentioned
low level synchronization construct
.Every time a request for allocation cannot be granted immediately, the
detection algorithm is invoked. This will help identify ____________
Select one:
the set of processes that have been deadlocked
the set of processes in the deadlock queue
the specific process that caused the deadlock
all of the mentioned
.The monitor construct ensures that ____________
Select one:
n number of processes can be active at a time within the monitor (n being greater
than 1)
only one process can be active at a time within the monitor
all of the mentioned
the queue has only one process in it at a time
.What are Spinlocks?
Select one:
Locks that work better on multiprocessor systems
Locks that avoid time wastage in context switches
All of the mentioned
CPU cycles wasting locks over critical sections of programs
.What are the two atomic operations permissible on semaphores?
Select one:
stop
wait
none of the mentioned
hold
.The wait operation of the semaphore basically works on the basic _______
system call.
Select one:
hold()
wait()
stop()
block()
.TestAndSet instruction is executed ____________
Select one:
atomically
after a particular process
periodically
none of the mentioned
.A system is in the safe state if ____________
Select one:
there exist a safe sequence
all of the mentioned
the system can allocate resources to each process in some order and still avoid a
deadlock
none of the mentioned

You might also like