# 題目
* 林子皓
1.List the state types and briefly describe them
* new: The process is being created
* running: Instructions are being executed
* waiting: The process is waiting for some event to occur
* ready: The process is waiting to be assigned to a processor
* terminated: The process has finished execution
2.How ready queue works
* ready queue is link list,use head to link them and use the tail to point out the last data.
3.
* 楊秉沅
1. Why does the process need a program counter?
Ans.
Because after the program is interrupted,the program store the breakpoint so that the CPU can find the address which to start at the next execution
2. What are the zombie and orphan mean in child process?
Ans.
If no parent waiting (did not invoke wait()) process is a zombie
If parent terminated without invoking wait , process is an orphan
3. What are two models of IPC, Please explain how they work.
Ans.
1.Shared memory. Process A put the data in shared memory, and Process B access the shared memory to obtain the data
2.Message Passing.Procees A use the system call to send the message to message queue which is in the kernel, and the kernel send the message to Process B.
* 王尚鵬
1. which of the follow statement is correct ?
Ans: (A)
(A) When an I/O generated by a process, the process state will change from “running” to “waiting”.
(B) When the process just been created and its state is currently “new”, it will get CPU resource immediately.
\(C) When division by zero or malicious access happen, the process will change its state to “waiting”, and wait for the event over.
2. Please explain what is swapping.
Ans: Remove process from memory, store on disk, bring back in from disk to continue execution.
3. When a parent process create children process, please explain two cases of execution options.
Ans: 1.Parent and children execute concurrently. 2. Parent waits until children terminate
* 楊閔恩
1. What information is contained in a Process Control Block (PCB)? Please explain.
1. process state.
2. program counter
3. cpu register
4. cpu scheduling information
5. memory managment information
6. accounting information
7. I/O status information
2. What do the short-term scheduler and long-term scheduler do, respectively? Please briefly explain.
1. short-term scheduler:select which process should be excuted next and allocates CPU.
2. long-term scheduler:select which process be brought into the ready queue.