1,2,3,4
1,2,3,4
Question 1 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the average waiting time of
the processes?
Mark 1.00 out of
1.00
Select one:
Flag question
2
3
5
4
Question 2 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of P1 ?
Question 3 Suppose a system uses SJN (or SJF) CPU scheduling algorithm. The processes information
Correct (arrival time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the total waiting time of the
processes?
Mark 1.00 out of
1.00
Select one:
Flag question
16
17
18
15
https://112.137.129.56/mod/quiz/review.php?attempt=2125 1/5
3/10/2020 Bài kiểm tra chương 1+2 (thi lần 2)
Question 4 Suppose a system uses SRTF (or preemtive SJF) scheduling algorithm. The processes
Incorrect information (arrival time, duration) is P1(0,24), P2(20,40), P3(30,10), P4(50,15). Show the order
(e.g. P1 P3 P1 P4 ...) in which the processes are run?
Mark 0.00 out of
1.00
Flag question
Answer: P1 P2 P3 P4
Round robin
Question 6 Which is INCORRECT about Shortest Job First (SJF) CPU scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 The shortest process will be selected to be run
Flag question Shortest remaining time first (SRTF) CPU scheduling algorithm is the same as SJF
It is also a priority scheduling algorithm
Question 7 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of P3 ?
Question 8 Suppose a system uses Round Robin (RR) CPU scheduling algorithm, the processes information
Correct (arrival time, duration) is P1(0,21), P2(30,10), P3(20,40), P4(40,25), and the time quantum is 15.
Calculate the total waiting time of the processes?
Mark 1.00 out of
1.00
Answer: 63
Flag question
Question 11 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Which is the response time of process P2?
8
12
Question 12 Suppose a system uses RR scheduling algorithm. The processes information (arrival time,
Correct duration) is P1(0,20), P2(30,10),P3(20,40), P4(40,25), and the time quantum is 15. Which is the
total waiting time of the processes?
Mark 1.00 out of
1.00
Select one:
Flag question
60
70
50
40
Question 13 Which is the CORRECT relationship among process, program and application concepts?
Correct
Select one:
Mark 1.00 out of
1.00 An application may have several programs, a program has only one process
Flag question An application has only one program, a program has only one process
https://112.137.129.56/mod/quiz/review.php?attempt=2125 3/5
3/10/2020 Bài kiểm tra chương 1+2 (thi lần 2)
An application may have several processes, a process may have several programs
An application may have several programs, a program may have several processes
Question 15 Suppose a system uses FCFS scheduling algorithm, the processes information (arrival time,
Correct duration) is P1(0,21), P2(30,10),P3(20,40), P4(50,15). Show the order in which the processes are
run (e.g. P2 P1 P3 P4)?
Mark 1.00 out of
1.00
Flag question
Answer: P1 P3 P2 P4
Question 16 Which is INCORRECT about Shortest Remaining Time First (SRTF) scheduling algorithm?
Correct
Select one:
Mark 1.00 out of
1.00 The shortest process will be run first
Flag question The shortest remaining time process will be selected to run
It is also a priority scheduling algorithm
Question 17 Suppose a system uses FCFS CPU scheduling algorithm. The duration of the processes is
Correct P1(21), P2(10), P3(6) (and this is also the order of the processes in the queue). Calculate the total
waiting time of the processes?
Mark 1.00 out of
1.00
Answer: 52
Flag question
Is an application
Question 20 Suppose a system uses SJN (or SJF) scheduling algorithm. The processes information (arrival
Correct time, duration) is P1(0,7), P2(2,4), P3(4,1), P4(5,5). Calculate the turnaround time of process P4 ?
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
https://112.137.129.56/mod/quiz/review.php?attempt=2125 5/5
3/10/2020 Bài kiểm tra chương 3, 4
UETOTS Thái Huy Nhật Quang
Flag question
PROCESS TAPES TAPES TAPES
P0 5 10 3
P1 2 4
P2 2 9
Which is the correct value of FINISH and WORK vectors during the running of Banke
r's algorithm?
Select one:
FINISH=(T, F, T) WORK=(10)
FINISH=(F, T, F) WORK=(10)
FINISH=(T, F, F) WORK=(10)
FINISH=(T, T, F) WORK=(10)
https://112.137.129.56/mod/quiz/review.php?attempt=2247 1/17
3/10/2020 Bài kiểm tra chương 3, 4
Question 2 Given the two bellow processes sharing three semaphores full, empty, mutex, and a buffer buff
Correct having initial N empty slots:
Flag question
int buff[N];
Write_Process:
do {
wait(empty);
wait(mutex);
Write(buff);
signal(mutex);
signal(full);
} while (TRUE);
Read_Process:
do {
wait(full);
https://112.137.129.56/mod/quiz/review.php?attempt=2247 2/17
3/10/2020 Bài kiểm tra chương 3, 4
wait(mutex);
Read(buff);
signal(mutex);
signal(empty);
} while (TRUE);
Select one:
Both semaphore mutex and full are used to ensure at most 1 process can access the buff at
a time.
Flag question
PROCESS A B C A B C A B
C
https://112.137.129.56/mod/quiz/review.php?attempt=2247 3/17
3/10/2020 Bài kiểm tra chương 3, 4
P0 0 1 0 0 0 0 0
0 0
P1 2 0 0 2 0 2
P2 3 0 3 0 0 0
P3 2 1 1 1 0 0
P4 0 0 2 0 0 2
Which is correct value of FINISH and WORK vectors during the running of the deadlock
detection algorithm?
Select one:
FINISH=(F, F, F, F, T), WORK=(0, 1, 0)
Flag question An edge from a resource vertex to a process vertex represents an instance of the resources
is allocated to the process
Flag question
https://112.137.129.56/mod/quiz/review.php?attempt=2247 4/17
3/10/2020 Bài kiểm tra chương 3, 4
wait(wrt);
write(data_set);
signal(wrt);
}while (TRUE);
Process reader Q:
do {
wait(mutex);
readcount++;
signal(mutex);
read(data_set);
wait(mutex);
readcount--;
signal(mutex);
https://112.137.129.56/mod/quiz/review.php?attempt=2247 5/17
3/10/2020 Bài kiểm tra chương 3, 4
} while (TRUE);
Which is the initialized value of the wrt variable in the above algorithm?
Select one:
NULL
0
1
-1
Question 7 Given the following code, with the globally shared variable int buf, and count() is a function.
Correct Which is correct when multiple instances of the code are running in the system?
Flag question
//Some code
int val=buf;
buf=val
Select one:
The globally shared variable buf can get an incorrect value when there are more than 1
instance of the code running.
The globally shared variable buf will always get an incorrect value when there are more than
2 instances of the code running.
https://112.137.129.56/mod/quiz/review.php?attempt=2247 6/17
3/10/2020 Bài kiểm tra chương 3, 4
The globally shared variable buf will always get an incorrect value when only 2 instances of
the code running.
The globally shared variable buf will always get the correct value.
Question 9 Given the following system information, and process P4 requests (1, 0, 0) more resources:
Correct
ALLOCATION MAX AVBALABLE
Mark 1.00 out of
1.00
Flag question
PROCESS A B C A B C A B
C
P0 0 1 0 7 5 3
2 3 0
P1 3 0 2 3 2 2
P2 3 0 2 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
Which is the correct value of FINISH and WORK vectors during the running of Banker's algorithm
which is called in the Resource-Request algorithm (to avoid deadlock)?
Select one:
FINISH=(F, T, F, F, F), WORK=(4,
https://112.137.129.56/mod/quiz/review.php?attempt=2247 3, 2) 7/17
3/10/2020 Bài kiểm tra chương 3, 4
FINISH=(F, F, T, F, F), WORK=(4, 3, 0)
FINISH=(F, F, F, T, F), WORK=(4, 3, 2)
FINISH=(F, T, F, F, F), WORK=(4, 3, 0)
Flag question
PROCESS A B C A B C A B
C
P0 0 1 0 0 0 0 0
0 0
P1 2 0 0 2 0 2
P2 3 0 3 0 0 0
P3 2 1 1 1 0 0
P4 0 0 2 0 0 2
Select one:
The algorithm results in FINISH=(F, T, T, T, T), WORK=(5, 1, 2), thus there is a deadlock.
The algorithm results in FINISH=(T, T, T, T, T), WORK=(7, 2, 4), thus there is no deadlock.
The algorithm results in FINISH=(F, T, T, T, T), WORK=(7, 2, 5), thus there is a deadlock.
The algorithm results in FINISH=(T, T, T, T, T), WORK=(7, 2, 6), thus there is no deadlock.
Question 11 Given the following system information, and process P0 requests (0, 2, 0) more resources:
Correct
ALLOCATION MAX AVBALABLE
Mark 1.00 out of
1.00
https://112.137.129.56/mod/quiz/review.php?attempt=2247 8/17
3/10/2020
Flag question Bài kiểm tra chương 3, 4
PROCESS A B C A B C A B
C
P0 0 1 0 7 5 3 3
3 2
P1 2 0 0 3 2 2
P2 3 0 1 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
Which is the correct value of FINISH and WORK vectors during the running of Banker's algorithm
which is called in the Resource-Request algorithm (to avoid deadlock)?
Select one:
FINISH=(F, T, T, F, T), WORK=(7, 3, 3)
Flag question Each process has to register the maximum number of resource instances it needs
Question 13 Given the two bellow processes sharing three semaphores full, empty, mutex, and a buffer buff
Correct having initial N empty slots:
1.00
int buff[N];
Flag question
Write_Process:
do {
wait(empty);
wait(mutex);
Write(buff);
signal(mutex);
signal(full);
} while (TRUE);
Read_Process:
do {
wait(full);
wait(mutex);
Read(buff);
https://112.137.129.56/mod/quiz/review.php?attempt=2247 10/17
3/10/2020 Bài kiểm tra chương 3, 4
signal(mutex);
signal(empty);
} while (TRUE);
Select one:
The maximum value of full is N.
Question 14 Given the following resource allocation graph, provide the name of the edge from P3 to R2
Correct (Assignment, Claim,or Request)?
Flag question
https://112.137.129.56/mod/quiz/review.php?attempt=2247 11/17
3/10/2020 Bài kiểm tra chương 3, 4
Answer: Request
Flag question
PROCESS A B C A B C A B
C
https://112.137.129.56/mod/quiz/review.php?attempt=2247 12/17
3/10/2020 Bài kiểm tra chương 3, 4
P0 0 1 0 0 0 0 0
0 0
P1 2 0 0 2 0 2
P2 3 0 3 0 0 1
P3 2 1 1 1 0 0
P4 0 0 2 0 0 2
Which is correct value of FINISH and WORK vectors during the running of the deadlock
detection algorithm?
Select one:
FINISH=(T, F, F, F, F), WORK=(2, 0, 0)
Flag question
wait(wrt);
write(data_set);
signal(wrt);
}while (TRUE);
https://112.137.129.56/mod/quiz/review.php?attempt=2247 13/17
3/10/2020 Bài kiểm tra chương 3, 4
Process reader Q:
do {
wait(mutex);
readcount++;
signal(mutex);
read(data_set);
wait(mutex);
readcount--;
signal(mutex);
} while (TRUE);
Select one:
To make sure there is one reader at a time
https://112.137.129.56/mod/quiz/review.php?attempt=2247 14/17
3/10/2020 Bài kiểm tra chương 3, 4
Question 17 Given the code for bounded-buffer problem:
Correct Write process P:
Flag question
wait(empty);
wait(mutex);
Write (item);
signal(mutex);
signal(full);
} while (TRUE);
Read process Q:
do {
wait(full);
wait(mutex);
Read(item);
signal(mutex);
signal(empty);
https://112.137.129.56/mod/quiz/review.php?attempt=2247 15/17
3/10/2020 Bài kiểm tra chương 3, 4
} while (TRUE);
What will be the problem if the initialized value of the full variable is 1?
Select one:
the reader process can not run
no problem at all
the reader can read an invalid value
the writer process can not run
Question 19 Given the following system information, and process P0 requests (0, 2, 0) more resources:
Incorrect
ALLOCATION MAX AVBALABLE
Mark 0.00 out of
1.00
Flag question
PROCESS A B C A B C A B
C
P0 0 1 0 7 5 3 3
3 2
P1 2 0 0 3 2 2
P2 3 0 1 9 0 2
P3 2 1 1 2 2 2
https://112.137.129.56/mod/quiz/review.php?attempt=2247 16/17
3/10/2020 Bài kiểm tra chương 3, 4
P4 0 0 2 4 3 3
Which is the correct value of FINISH and WORK vectors during the running of Banker's algorithm
which is called in the Resource-Request algorithm (to avoid deadlock)?
Select one:
FINISH=(F, F, T, F, T), WORK=(7, 3, 3)
Flag question Two processes shares data in a file via file mapping.
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
https://112.137.129.56/mod/quiz/review.php?attempt=2247 17/17
7/4/2019 Bài kiểm tra chương 3, 4
UETOTS Nguyễn Trí Công
Question 1 Which is CORRECT about the bounded waiting condition of critical section?
Correct
Select one:
Mark 1.00 out of
1.00 It makes sure no process can never enter its critical section, or ensures the fairness
among processes
Flag question
It ensures the correct use of the shared resource
It utilizes the shared resource effectively
It supports the priority of processes
Flag question
wait(wrt);
write(data_set);
signal(wrt);
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 1/16
7/4/2019 Bài kiểm tra chương 3, 4
}while (TRUE);
Process reader Q:
do {
wait(mutex);
readcount++;
signal(mutex);
read(data_set);
wait(mutex);
readcount--;
signal(mutex);
} while (TRUE);
Which is the initialized value of the mutex variable in the above algorithm?
Select one:
0
NULL
-1
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 2/16
7/4/2019 Bài kiểm tra chương 3, 4
1
Question 3 Given the following resource allocation graph. What is the correct name of the edge from P2
Correct to R3?
Flag question
Select one:
Assignment edge.
Request edge.
Claim edge.
1.00 Condition
Flag question
Semaphore
Monitor
Peterson’s solution
Question 5 Given the following system information, and process P0 requests (0, 2, 0) more resources:
Correct
ALLOCATION MAX AVBA
Mark 1.00 out of
LABLE
1.00
Flag question
PROCESS A B C A B C A
B C
P0 0 1 0 7 5 3
3 3 2
P1 2 0 0 3 2 2
P2 3 0 1 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
Which is the correct value of FINISH and WORK vectors during the running of Banker's
algorithm which is called in the Resource-Request algorithm (to avoid deadlock)?
Select one:
FINISH=(F, T, F, F, F), WORK=(3, 3, 2)
FINISH=(F, F, T, F, F), WORK=(3, 0, 2)
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 4/16
7/4/2019 Bài kiểm tra chương 3, 4
Question 6 Which is INCORRECT about safe state? The system is in safe state if there exists a
Correct sequence of processes that satisfies the following condition:
Question 7 Given the following system information, and process P4 requests (1, 0, 0) more resources:
Correct
ALLOCATION MAX AVBA
Mark 1.00 out of
LABLE
1.00
Flag question
PROCESS A B C A B C A
B C
P0 0 1 0 7 5 3
3 3 2
P1 2 0 0 3 2 2
P2 3 0 1 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
Which is the correct value of FINISH and WORK vectors during the running of Banker's
algorithm which is called in the Resource-Request algorithm (to avoid deadlock)?
Select one:
FINISH=(F, F, T, T, T), WORK=(10, 5, 5)
FINISH=(F, T, F, T, T), WORK=(9, 4, 4)
Question 8 Given the following resource allocation graph, provide the name of the edge from R2 to P4
Correct (Assignment, Claim,or Request)?
Flag question
Answer: Assignment
Flag question wait (or P) operator is corresponding to ENTRY in the protocol of a critical section
Semaphore includes an integer and two atomic operators.
Question 11 Given the following system information, and process P0 requests (0, 2, 0) more resources:
Correct
ALLOCATION MAX AVBA
Mark 1.00 out of
LABLE
1.00
Flag question
PROCESS A B C A B C A
B C
P0 0 1 0 7 5 3
3 3 2
P1 2 0 0 3 2 2
P2 3 0 1 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
Which is the correct value of FINISH and WORK vectors during the running of Banker's
algorithm which is called in the Resource-Request algorithm (to avoid deadlock)?
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 7/16
7/4/2019 Select one: Bài kiểm tra chương 3, 4
Question 13 Which is the correct protocol to run a critical section named CS?
Correct
A)
Mark 1.00 out of
1.00
Flag question
do {
ENTRY;
Before_Code;
CS;
EXIT;
After_Code;
} while (TRUE);
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 8/16
7/4/2019 Bài kiểm tra chương 3, 4
B)
do {
Before_Code;
ENTRY;
CS;
EXIT;
After_Code;
} while (TRUE);
C)
do {
ENTRY;
Before_Code;
CS;
After_Code;
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 9/16
7/4/2019 Bài kiểm tra chương 3, 4
EXIT;
} while (TRUE);
D)
do {
Before_Code;
ENTRY;
CS;
After_Code;
EXIT;
} while (TRUE);
Select one:
C
B
D
A
It finds out the safe sequence of the system when a process requests a resource
It does not detect the unsafe state of the system
Flag question
A B C A B
C A B C
P0 0 1 0 0 0
0 0 0 0
P1 2 0 0 2 0
2
P2 1 0 1 0 1
0
P3 2 1 1 1 0
2
P4 0 0 2 0 0
2
Select one:
The system is in a deadlock and P1, P2, P3, P4 are in the deadlock
The system is in a safe state since P0 P2 P1 P3 P4 is a safe sequence
The system is in a deadlock and P1, P3, P4 are in the deadlock
The system is in a deadlock and P0, P1, P2, P3, P4 are in the deadlock
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 11/16
7/4/2019 Bài kiểm tra chương 3, 4
Question 16 Given the following system information, and process P0 requests (0, 2, 0) more resources:
Correct
ALLOCATION MAX AVBA
Mark 1.00 out of
LABLE
1.00
Flag question
PROCESS A B C A B C A
B C
P0 0 1 0 7 5 3
3 3 2
P1 2 0 0 3 2 2
P2 3 0 1 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
Which is the correct value of FINISH and WORK vectors during the running of Banker's
algorithm which is called in the Resource-Request algorithm (to avoid deadlock)?
Select one:
FINISH=(F, F, F, F, F), WORK=(3, 1, 2)
Question 18 Given the code of a philosopher in the Dinning-philosophers problem with 5 philosophers:
Incorrect
do {
Mark 0.00 out of
1.00
Flag question
wait(chopstick[i]);
wait(chopstick[(i+1)%5];
Eat(i);
signal(chopstick[i]);
signal(chopstick[(i+1)%5];
Think(i);
} while (TRUE);
Select one:
2
0
1
5
Flag question
PROCESS A B C A B C A
B C
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 13/16
7/4/2019 Bài kiểm tra chương 3, 4
P0 0 1 0 0 0 0
0 0 0
P1 2 0 0 2 0 2
P2 3 0 3 0 0 0
P3 2 1 1 1 0 0
P4 0 0 2 0 0 2
Which is correct value of FINISH and WORK vectors during the running of the deadlock
detection algorithm?
Select one:
FINISH=(F, T, F, T, F), WORK=(2, 0, 0)
Flag question
wait(wrt);
write(data_set);
signal(wrt);
}while (TRUE);
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 14/16
7/4/2019 Bài kiểm tra chương 3, 4
Process reader Q:
do {
wait(mutex);
readcount++;
signal(mutex);
read(data_set);
wait(mutex);
readcount--;
signal(mutex);
} while (TRUE);
Which is the initialized value of the wrt variable in the above algorithm?
Select one:
-1
NULL
0
1
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 15/16
7/4/2019 Bài kiểm tra chương 3, 4
Finish review
QUIZ NAVIGATION
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Show one page at a time
Finish review
https://112.137.129.56/mod/quiz/review.php?attempt=2291#q11 16/16