Chapter 3 - Processes Flashcards
What does a process contain?
1) Program Counter
2) Stack
3) Data Section
What are the four aspects of a process?
1) Text Section
2) Stack
3) Data section
4) Heap
What is in the text section of a process?
Program code itself
What is in a process’s stack?
Temporary data such as function parameters, return addresses, and local variables
What is in a process’ data section?
Global variables
What is in a process’ heap?
Memory dynamically allocated during run-time
What is in the Process Control Block?
Information associated with each process
What information does the PCB contain on each process? (6 total)
process state, PC, CPU registers, scheduling information, accounting information, and I/O status information
What are the two types of processes and what do they mean?
I/O Bound: spends more time doing I/O (many short CPU bursts)
CPU Bound: spends more time doing computations (few long CPU bursts)
What does a context switch do?
When the CPU switches to another process, it saves the state of the old and loads the saved state of the new (from PCB)
What is the timing of a context switch depend on?
Hardware
How are child processes created?
When a parent process uses the fork() system call
What does the PID do?
Allow for process management
True or False: Parents and children can share all/some/none resources
True
True/False: Parents always wait until children terminate to execute
False
How do you create a new process?
With the fork() call
What does the exec() system call do?
Used after a fork() to replace the processes’ memory space with a new program
What is interprocess communication?
Needed by cooperating processes to share memory or pass messages
What are the types of message passing?
Blocking or non-blocking, aka synchronous or asynchronous
What does blocking message passing mean?
Blocking Send/Receive has the sender/receiver block until the message is sent/recieved
What does non-blocking message send mean?
Non-blocking send has the sender send the message and continue
What does non-blocking receive mean?
The receiver receives a valid message or null