Pre Test 2
Pre Test 2
2. 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 ____________
Câu hỏi 2Select one:
data consistency
starvation
race condition
aging
3. Cascading termination refers to termination of all child processes if the parent process
terminates ______
Câu hỏi 3Select one:
None of the mentioned
Abnormally
Normally or abnormally
Normally
6. In UNIX, the return value for the fork system call is _____ for the child process and
_____ for the parent process.
Câu hỏi 6Select one:
Zero, A Negative integer
A Negative integer, Zero
A nonzero integer, Zero
Zero, A nonzero integer
9. The child process completes execution, but the parent keeps executing, then the child
process is known as __________
Câu hỏi 9Select one:
Orphan
Dead
Body
Zombie
P1 0 8
P2 1 4
P3 2 9
P4 3 5
If using the SRT scheduling algorithm, the turnaround time of P3 is
12. A procedure defined within a ________ can access only those variables declared
locally within the _______ and its formal parameters.
Câu hỏi 12Select one:
process, monitor
semaphore, semaphore
process, semaphore
monitor, monitor
14. 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?
Câu hỏi 14Select one:
critical exclusion
asynchronous exclusion
mutual exclusion
synchronous exclusion
15. Which process can be affected by other processes executing in the system?
Câu hỏi 15Select one:
init process
child process
cooperating process
parent process
16. The segment of code in which the process may change common variables, update
tables, write into files is known as ____________
Câu hỏi 16Select one:
synchronizing
critical section
program
non – critical section
17. What are Spinlocks?
Câu hỏi 17Select one:
Locks that avoid time wastage in context switches
Locks that work better on multiprocessor systems
All of the mentioned
CPU cycles wasting locks over critical sections of programs
18. Consider a system with 4 processes with the following parameters:
Arriv Burs
Proces
al t
s
time time
P1 0 6
P2 0 8
P3 0 7
P4 0 3
If using the SJF process scheduling algorithm, the average waiting time of the processes
is
P4 P1 P3 P2
0 3 9 16 24
WT: TAT - BT
P1: (9 – 0) – 6 = 3
P2: (24 – 0) – 8 = 16
P3: (16 – 0) – 7 = 9
P4: (3 – 0) – 3 = 0
AVG WT = 7
19. Concurrent access to shared data may result in ____________
Câu hỏi 19Select one:
data insecurity
data inconsistenc
ydata consistency
none of the mentioned
Đáp án: 24
Đáp án: Safe state
Đáp án: At least twice
33 0 48 4 13 28 0 0 8
P1 P2 P3 P4 P1 P3 P4 P1 P3 P3
0 20 28 48 68 88 108 112 125 145 153
WT = TAT – BT
P1 = (125 – 0) – 53 = 72
P2 = (28 – 0) – 8 = 20
P3 = (153 – 0) – 68 = 85
P4 = (112 – 0) – 24 = 88
https://www.studocu.vn/vn/document/truong-dai-hoc-su-pham-ky-thuat-thanh-pho-ho-
chi-minh/he-dieu-hanh/kiem-tra-lan-2-de-thi-dap-an/51711796