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

quizOS Process Thread

OS HCMUT QUIZ

Uploaded by

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

quizOS Process Thread

OS HCMUT QUIZ

Uploaded by

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

1) Choose the correct state transition.

The correct state transition for a typical process lifecycle in an operating system is:

c. new - ready - running - waiting - ready - running - terminated

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

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

3) The bounded buffer problem is also known as ____________.


c. Producer – Consumer problem

4) What is context switch?

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

5) 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?

b. Children can run normally but parent executes an infinite loop.

6) What is a Process Control Block? c. Data Structure

7) Process Control Block(PCB) does not contain which of the following? ChatGPT đã nói:

b. Bootstrap program

8) Termination of the process terminates ___________ c. all threads within the


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

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

10) Thread synchronization is required because ___________

c. All of the mentioned {

all threads of a process can share the same files

all threads of a process share the same address space

All of the mentioned

all threads of a process share the same global variables

11) Which of the following is FALSE?

a. Blocking one kernel level thread blocks all other related threads

You might also like