0% found this document useful (0 votes)
26 views

Process and Thread

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Process and Thread

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Bắt đầu vào lúc Thứ Bảy, 24 tháng 2 2024, 7:54 PM

Trạng thái Đã xong


Kết thúc lúc Thứ Bảy, 24 tháng 2 2024, 8:00 PM
Thời gian thực 6 phút 17 giây
hiện
Điểm 10,00 trên 10,00 (100%)

Câu hỏi 1
Đúng

Đạt điểm 1,00 trên 1,00

The time required to create a new thread in an existing process is:

a. equal to the time required to create a new process.

b. greater than the time required to create a new process.

c. None of the mentioned

d. less than the time required to create a new process. 

Câu trả lời của bạn đúng

The correct answer is: less than the time required to create a new process.

Câu hỏi 2
Đúng

Đạt điểm 1,00 trên 1,00

Thread synchronization is required because ___________

a. all threads of a process share the same global variables

b. All of the mentioned 

c. all threads of a process share the same address space

d. all threads of a process can share the same files

Câu trả lời của bạn đúng

The correct answer is: All of the mentioned


Câu hỏi 3
Đúng

Đạt điểm 1,00 trên 1,00

Which of the following is FALSE?

a. Related kernel level threads can be scheduled on different processors in a multiprocessor system

b. Context switch time is longer for kernel level threads than for user level threads.

c. Kernel threads can take the advantages of multiprocessor architecture.

d. Blocking one kernel level thread blocks all other related threads 

Câu trả lời của bạn đúng

The correct answer is: Blocking one kernel level thread blocks all other related threads

Câu hỏi 4
Đúng

Đạt điểm 1,00 trên 1,00

Given the following code:

int main(){

int done =0;

int pid = fork();

if(pid = = 0){

printf(“Hello Child\n”);

done = 1;

exit(0);

else if(pid>0) {

while(done == 0);

printf(“Hello Parent \n”);

exit(1);

What will happen when executing this code?

a. Children can run normally but parent executes an infinite loop. 

b. Parent executes first, children will run when parent completes its task.

c. Parent executes an infinite loop, causing children suspended.

d. Children execute first, parent waits and resumes when children completes its task.

Câu trả lời của bạn đúng



The correct answer is: Children can run normally but parent executes an infinite loop.
Câu hỏi 5
Đúng

Đạt điểm 1,00 trên 1,00

Choose the correct state transition.

a. new - ready - waiting - ready - running - terminated

b. new - ready - running - waiting - ready - running – terminated 

c. new - ready - running - waiting - terminated

d. new - waiting - ready - running - terminated

Câu trả lời của bạn đúng

The correct answer is: new - ready - running - waiting - ready - running – terminated

Câu hỏi 6
Đúng

Đạt điểm 1,00 trên 1,00

If the kernel is single threaded, then any user level thread performing a blocking system call will ___________

a. cause the entire process to block even if the other threads are available to run. 

b. cause the thread to block with the other threads running.

c. cause the entire process to run along with the other threads.

d. None of the mentioned

Câu trả lời của bạn đúng

The correct answer is: cause the entire process to block even if the other threads are available to run.

Câu hỏi 7
Đúng

Đạt điểm 1,00 trên 1,00

Process Control Block(PCB) does not contain which of the following?

a. Stack

b. Data

c. Code

d. Bootstrap program 

Câu trả lời của bạn đúng

The correct answer is: Bootstrap program


Câu hỏi 8
Đúng

Đạt điểm 1,00 trên 1,00

Termination of the process terminates ___________

a. no thread within the process

b. first thread of the process.

c. all threads within the process 

d. first two threads of the process

Câu trả lời của bạn đúng

The correct answer is: all threads within the process

Câu hỏi 9
Đúng

Đạt điểm 1,00 trên 1,00

What is a Process Control Block?

a. A Block in memory

b. A secondary storage section

c. Data Structure 

d. Process type variable

Câu trả lời của bạn đúng


The correct answer is: Data Structure

Câu hỏi 10
Đúng

Đạt điểm 1,00 trên 1,00

What is context switch?

a. process execution completes an instruction and load the new instruction to execute next.

b. the system must save the state of the old process and load the saved state for the new process. 

c. suspend a process and move it to disk.

d. process transfer from the new state to the ready state.

Câu trả lời của bạn đúng


The correct answer is: the system must save the state of the old process and load the saved state for the new process.


You might also like