OS - Week3 - Recitation2 - Answers For TA
OS - Week3 - Recitation2 - Answers For TA
OS: chap3,4_Process,Threads
2) The basic Two-State Process Model defines two possible states for a process in relationship to
the processor:( )
A.Executing and Waiting
B.Running and Executing
C.Running and Not Running
D.None of the above
3) There are a number of conditions that may lead to process termination, including:( )
A.Normal completion
B.Bounds violation
C.Parent termination
D.All of the above
4) In the Five-State Process Model, the following represents a valid state transition:( )
A.All of the above
B.New -> Blocked
C.New -> Running
D.Running -> Blocked
5) In a Process Model that implements two suspend states, a valid state transition is represented
by:( )
A.Ready -> Ready/Suspend
B.Ready/Suspend -> Ready
C.All of the above
D.Running -> Ready/Suspend
6) The Process Image element that contains the collection of attributes needed by the O/S to
control a particular process is called the:( )
A.Process Control Block
B.User Data
C.System Stack
None of the above
7)The processor execution mode that user programs typically execute in is referred to as:( )
A.Kernel mode
B.User mode
C.System mode
D.None of the above
8) About the CPU mode switch and process switch, which one is correct? ( )
I. When the CPU mode switch happens, the process switch must happen too.
II.When the process switch happens, the CPU mode switch must happen too.
III. the CPU mode switch is much more complex than process switch.
A.I
B.II
C.II and III
D.I and III
9)A process switch may occur when the system encounters an interrupt condition, such as that
generated by a:( )
A.System call
B.Trap
C.Memory fault
D.All of the above
10)As for the module of process, which system call usually be provided for the application
development? ( )
I. create a new process;
II. terminate a process;
III. make the running process change into block state;
A.I
B.I,II
C.II, and III
D.All of them
13)Which of the following is true regarding the relationship between processes and threads:( )
A.It takes less time to create a new thread in an existing process than create a new process
B.It takes less time to switch between 2 different processes than switch between 2 threads
within the same process
C.It takes less time to terminate a process than a thread
D.All of the above
14)One of the disadvantages of User-Level Threads (ULTs) compared to Kernel-Level Threads (KLT
s) is: ( )
A.When a ULT executes a block system call, all threads in the process are blocked
B.Thread switching does not require kernel mode privileges
C.Scheduling is application specific
D.All of the above
15)Which of the following is not a valid process state in the Five-State Process Model?
A) Ready
B) Suspended
C) Running
D) Exit
2. Open-Ended Questions
1)Moving a process from Running to another state (Ready, Blocked, etc.), requires some steps.
What are those steps? (use your own words to summarize each step into a short phrase.)
Answers:
1 Save the current context
2 Update the process control block (PCB)
3 Queue the PCB in the appropriate list
4 Select another process for execution
5 Update the new process's PCB
6 Update memory management
7 Restore the context
TA’s Reference:
2)What’s the differences between processes and threads? (use any short metaphor that suits you
well to illustrate)
TA’s Reference:
This metaphor helps visualize how threads are lightweight and work within the same
process.
processes as tasks and threads as mini-tasks......
processed as whole cars and threads as passengers inside the car......
3)Draw the fig(s) on Five-state process model by yourself (either by hand, or by software, such as
powerpoint,etc).
Answers:
4)Give short descriptions with your own words on Five-state process model to illustrate each of
the following:
A) The meaning of each node
B) The meaning of each line with arrow