Unit 2: Process Management Flashcards
What is a process?
A process is a program in execution
What distinguishes a program from a process?
A program is a passive entity stored on disk, while a process is the active execution of that program in memory
What are the key components of a process in memory?
- Text section (code)
- Data section (global/static variables)
- Heap (dynamic memory)
- Stack (temporary data)
What does the new state of a process signify?
It indicates that a process is being created and the OS has copied the program from secondary to main memory
What is the ready state of a process?
The ready state is when a process is waiting to be assigned to a processor, typically residing in the ready queue
What occurs in the running state of a process?
The process’s instructions are being executed by the CPU
What does the waiting state of a process entail?
The process is waiting for some event to occur, such as I/O completion
What does the terminated state of a process indicate?
The process has finished its execution
What is a Process Control Block (PCB)?
The PCB stores essential information associated with each process, allowing the OS to manage it
What key information is found in a PCB?
- Process state
- Program counter
- CPU registers
- CPU scheduling information
- Memory-management information
- Accounting information
What is the function of the job queue?
Holds a list of all processes in the system
What does the ready queue contain?
Processes residing in main memory and ready to execute
What is the purpose of device queues?
Hold processes waiting for a specific I/O device
What happens during process migration?
Processes move between the various scheduling queues during their lifecycle
What is context switching?
Saving the state of one process and restoring the state of another, often triggered by interrupts
What does the fork() system call do?
Creates a new child process, which is initially a duplicate of the parent
What is the function of the exec() system call?
Replaces the current process’s memory space with a new program after a fork()
How does a process terminate?
By executing its last statement and using the exit() system call, potentially returning a status to the parent
What does the abort() system call do?
Allows a parent process to terminate child processes for reasons like exceeding resources
What are independent processes?
Processes that cannot affect or be affected by others
What are cooperating processes?
Processes that can affect or be affected by others
What are some reasons for process cooperation?
- Information sharing
- Computation speedup
- Modularity
- Convenience
What is Inter-Process Communication (IPC)?
Needed for cooperating processes to exchange data and synchronise
What is shared memory IPC?
A region of memory shared between processes, allowing direct access for communication, but requiring user-managed synchronisation