Đề 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

lOMoARcPSD|38329449

HỆ ĐIỀU HÀNH - Trắc nghiệm HDH

Hệ điều hành (Trường Đại học Sư phạm Kỹ Thuật Thành phố Hồ Chí Minh)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)
lOMoARcPSD|38329449

HỆ ĐIỀU HÀNH
1. The CPU transferring from one process/thread to another is called
Select one:
a.context switch
B.task switch
C.process switch
D.the rest of the options are correct
2. Which system call returns the PID of the terminated child process?

Select one:
a.exit
b.wait
c.get
d.fork
3. In a time-sharing operating system, when the CPU time allocated to a process
expires, what state will the process go from running to?

Select one:

a.Blocked
b.Ready
c.Terminated
d.Suspended
4. The performance of the Round Robin algorithm is highly dependent on

Select one:
a.size of the process
b.CPU time required by the process
c. data export/import time of the process
d.The magnitude of the time quantum
5. The term "aging" refers to

Select one:

a.keeping track of how a page is swapped in/out memory according to the LRU
page replacement algorithm
b.initialization of a process in a multilevel queue without a response.
c.gradually increase the priority of long-awaited processes in the system to
overcome the infinite process blocking
d.letting the process sit in memory for a certain amount of time so that it can
accurately estimate the number of pages needed.
6. In Unix, what system call creates a new process?

Select one:

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

a. create
b.fork
c. new
d.release
7. The state of a process is determined by

Select one:

A.the last activity of the process

B.current activity of the process

C.the operation just performed by the process

D.the next operation to be performed by the process


8. Process is also known as

Select one:

A.thread

B.heavy weight process

C.the rest of the options are not correct

D.light weight process


9. Which word does not indicate the state of a process?

Select one:

new

finished

the rest of the options are all wrong

running

ready
10. READY is the state of a process

Select one:

when a process cannot run until a certain task is completed

the rest of the options are wrong.

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

when the process is scheduled to run after execution

when process is using CPU


11. What is Dispatch Latency ?

Select one:

the time lost by the dispatcher to stop one process and start another

the time taken by the processor to write a file to disk

the entire time used by the processor

the rest of the options are all wrong


12. Inter-Process Communication

Select one:

allows processes to communicate and synchronize their actions using the same
address space

allows processes to communicate and synchronize their actions without using


the same address space

allows processes to synchronize only their activity without communication

The rest of the options are incorrect


1. Whenever a resource allocation request cannot be granted immediately, the
deadlock detection algorithm is invoked. This will help identify:

Select one:

A.set of deadlocked processes

B.All correct

C.Specific processes cause deadlock

D.set of processes in the deadlock queue


2. Cost factors for process termination include ____________

Select one:

A.CPU utilization at the time of deadlock

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

B.All of the mentioned

C.Amount of time a deadlocked process has thus far consumed during its
execution

D.Number of resources the deadlock process is not holding


3. Which one of the following is a synchronization tool?

Select one:

A.semaphore

B.pipe

C.socket

D.thread
4. The wait-for graph is a deadlock detection algorithm that is applicable
when ____________
a) all resources have a single instance
b) all resources have multiple instances
c) all resources have a single 7 multiple instances
d) all of the mentioned
binary and counting
5. The two types of semaphore are

6. Which system call returns the PID of the terminated child process?

Select one:

A.wait

B.exit

C.fork

D.get

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

7. Which of the following statements is not correct for a solution to a critical


section problem ?

Select one:

A.Processes do not wait forever to enter its critical section.

B.Processes running outside its critical section may block other processes.

C.No two processes may be simultaneously inside their critical sections.

D.No assumptions may be made about speeds or the number of CPUs.


8. A monitor is characterized by ____________

Select one:

A.a set of programmer defined operators

B.the number of variables in it

C.an identifier

D.all of the mentioned


9. To avoid deadlock ____________

(a) there must be a fixed number of resources to allocate

(b) resource allocation must be done only once

(c) all deadlocked processes must be aborted

(d) inversion technique can be used


10. Deadlock prevention is a set of methods ____________

Select one:

A.to recover from a deadlock

B.to decide if the requested resources for a process have to be given or not

C.to ensure that all of the necessary conditions do not hold

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

D.to ensure that at least one of the necessary conditions cannot hol
11. .A minimum of _____ variable(s) is/are required to be shared between
processes to solve the critical section problem.

Select one:

a.three

B.four

C.one

D.two
12. Which is the process of invoking the wait operation?

Select one:

A.waiting for another process to complete before it can itself call the signal
operation

B.stopped until the next process in the queue finishes execution

C.suspended until another process invokes the signal operation

D.none of the mentioned


13. .What is the drawback of banker’s algorithm?

Select one:

A.in advance processes rarely know how much resource they will need

B.all of the mentioned

C.the number of processes changes as time progresses

D.resource once available can disappear


14. Mutual exclusion implies that ____________

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

Select one:

A.none of the mentioned

B.if a process is executing in its critical section, then no other process must
be executing in their critical sections

C.if a process is executing in its critical section, then other processes must
be executing in their critical sections

D.if a process is executing in its critical section, then all the resources of
the system must be blocked until it finishes execution
15.
What is the deadlock handling method? Cả 3 ý đều đúng

A. Use methods to ensure the system will never enter a deadlock state

B. Allow the system to enter deadlock state and then recover

C. Pretend that deadlock never happens in the system


16. To ensure no preemption, if a process is holding some resources and
requests another resource that cannot be immediately allocated to it
____________

Select one:

A.then all resources currently being held are preempted

B.the process resumes execution without the resource being allocated to it

C.then the process waits for the resources be allocated to it

D.the process keeps sending requests until the resource is allocated to it


17. If we preempt a resource from a process, the process cannot continue
with its normal execution and it must be ____________

Select one:

a.rolled back

B.terminated

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

C.aborted

d.queued
18. To avoid deadlock

Select one:

A.All deadlocked processes need to be removed

B.a set number of allocated resources are required

C.only allocate resources to processes holding resources

D.resource allocation needs to be done only once


deadlock
19. is a problem that is addressed when considering
concurrent processes, which are closely related to deadlock
20. The 'Circular wait' condition can be prevented by

Select one:

A.all not correct

B.Define a linear order of resource types and enter the resource level

C.using pipe

D.using thread
21. To _______ to a safe state, the system needs to keep more information
about the states of processes.
a.
abort the process
b.
roll back the process
c.
queue the process
d.
none of the mentioned
22. Those processes should be aborted on occurrence of a deadlock, the
termination of which?

Select one:

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

A.is more time consuming

B.safety is not hampered

C.all of the mentioned

D.incurs minimum cost


23. A deadlock avoidance algorithm dynamically examines the __________
to ensure that a circular wait condition can never exist.

Select one:

A.system storage state

B.resource allocation state

C.resources

D.operating system
24. To enable a process to wait within the monitor __________

Select one:

A.semaphore must be used

B.condition variables must be used as boolean objects

C.all of the mentioned

D.a condition variable must be declared as condition

25. .In the bakery algorithm to solve the critical section problem
____________

Select one:

A.each process is put into a queue and picked up in an ordered manner

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

B.each process gets a unique number and the one with the lowest number
is served next

C.each process gets a unique number and the one with the highest number
is served next

D.each process receives a number (may or may not be unique) and the one
with the lowest number is served next

26. If the wait for graph contains a cycle ____________

Select one:

A.then a deadlock exists

B.then a deadlock does not exist

C.either deadlock exists or system is in a safe state

D.then the system is in a safe state

27. .A monitor is a type of ____________

Select one:

A.semaphore

B.high level synchronization construct

C.low level synchronization construct

D.none of the mentioned

28. Whenever a resource allocation request cannot be granted immediately,


the deadlock detection algorithm is invoked. This will help identify:

Select one:

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

A.set of processes in the deadlock queue

B.Specific processes cause deadlock

C.All correct

D.set of deadlocked processes

29. 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

A Negative integer, Zero

Zero, A nonzero integer

Zero, A Negative integer


30. The wait operation of the semaphore basically works on the basic
_______ system call.

Select one:

A.hold()

B.wait()

C.stop()

D.block()
31. Mutual exclusion can be provided by the __________

Select one:

mutex locks

both mutex locks and binary semaphores

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

none of the mentioned

binary semaphores
32. For sharable resources, mutual exclusion ____________

Select one:

none of the mentioned

is not required

is required

may be or may not be required


33. For sharable resources, mutual exclusion ____________

Select one:

none of the mentioned

is not required

is required
34. Which of the following statements is not correct for a solution to a
critical section problem ?

Select one:

No two processes may be simultaneously inside their critical sections.

No assumptions may be made about speeds or the number of CPUs.

Processes running outside its critical section may block other processes.

Processes do not wait forever to enter its critical section.


35. What is the solution to starvation?

Select one:

the number of rollbacks must be included in the cost factor

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

the number of resources must be included in resource preemption

resource preemption be done instead

all of the mentioned


36. .If deadlocks occur frequently, the detection algorithm must be invoked
________

Select one:

rarely

rarely & frequently

frequently

none of the mentioned


37. .The two ways of aborting processes and eliminating deadlocks are
____________

Select one:

All of the mentioned

Abort all processes

Abort all deadlocked processes

Abort one process at a time until the deadlock cycle is eliminated


38. .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

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

aging

data consistency
39.

Which system call returns the PID of the terminated child process?

Select one:

get

wait

exit

fork
40.What are the operations that can be invoked on a condition variable?

Select one:

signal & hold

continue & signal

wait & signal

hold & wait


41.The Banker’s algorithm is _____________ than the resource allocation graph
algorithm.

Select one:

equal

less efficient

more efficient

none of the mentioned


42.What is a reusable resource?

Select one:

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

that can be used by one process at a time and is not depleted by that use

that can be shared between various threads

none of the mentioned

that can be used by more than one process at a time


43.Which of the following is NOT true for plans to prevent and avoid deadlock?

Select one:

In the case of deadlock avoidance, resource requests are always granted if the
resulting state is safe

Avoid deadlock is less restrictive than preventing deadlock

In the deadlock prevention, resource requests are always accepted if the


resulting state is safe

Avoid deadlock requires prior knowledge of resource requirements


44..Bounded waiting implies that there exists a bound on the number of times a
process is allowed to enter its critical section ____________

Select one:

when another process is in its critical section

after a process has made a request to enter its critical section and before the
request is granted

none of the mentioned

before a process has made a request to enter its critical section

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)


lOMoARcPSD|38329449

Downloaded by Vu Xuan Quang (22110212@student.hcmute.edu.vn)

You might also like