Lecture 03 Flashcards
What are the four possible status codes for a process?
O, S, R, and Z
What does the process status code ‘O’ mean?
The process is running on a processor.
What does the process status code ‘S’ mean?
The process is sleeping.
It is waiting for an event complete.
What does the process status code ‘R’ mean?
Runnable.
The process is on run queue.
What does the process status code ‘Z’ mean?
The process is in Zombie State.
It has terminated and the parent is not waiting.
What is a process?
A program in execution.
What function is used to get a processes id?
getpid()
What function is used to create a new process?
fork()
Parent and child processes execute:
A - In Parallel
B - In Series
In parallel.
What is the return value of fork for the parent process?
The new child’s process id.
What is the return value of fork for the child process?
0
What function is used to get the process id of a process’ parent?
getppid
What happens if a parent terminates before its child process?
The child is assigned the ‘init’ process as its parent.
What process id does the ‘init’ process have?
1.
What happens to the memory space of a process (in theory), after a fork?
Its entire memory space is copied to the new process so that they both have an independent copy.