Processes Flashcards
What is a process?
A process is a container that holds all the information needed to run a program. It includes the program’s instructions, variables, attributes, and the associated execution context.
What is the purpose of a process in an operating system?
The purpose of a process is to execute a program and manage its resources. It allows for concurrent execution of multiple processes, each with its own context, without interfering with each other.
What information does a process contain?
A process contains the program’s instructions, variables, temporary data, ownership information, file usage, and other attributes relevant to its execution.
Where is most of the process’s context stored?
Most of the process’s context, including its instructions and variables, is stored in memory. The process has its own address space within the memory, which may be contiguous or fragmented into logical segments.
What is a process control block (PCB)?
A process control block is a data structure maintained by the operating system to store private information about a process. It tracks the process’s resources, ownership, and other relevant details.
How does the operating system manage the execution of multiple processes?
The operating system’s scheduler manages the execution of multiple processes by determining when a process should run, get blocked, or be pushed aside to allow other processes to execute. This scheduling ensures fair and efficient utilization of system resources.
What is the relationship between processes in a Unix-like system?
In a Unix-like system, processes are organized in a hierarchy, where each process has a parent process. The first process (number 0) forks the init process, which becomes the parent of subsequent child processes.
What happens to orphaned child processes in Unix-like systems?
If a parent process expires before its children, the orphaned child processes are adopted by the init process. This ensures that the operating system maintains control over all active processes.
What are “zombie” processes in Unix-like systems?
“Zombie” processes are child processes that have terminated but have not been observed by their parent processes. The operating system retains the details of these terminated processes until the parent synchronizes with them. Persistent zombies usually indicate a bug in the system.
What does the context of an executing process include?
The context of an executing process includes its variables, resources, and environment in which it operates.
Where is most of the context of a process stored?
Most of the context of a process is stored in the main memory of the computer. This includes variables in memory or processor registers and resources owned by the process.
What is a Process Control Block (PCB)?
A Process Control Block (PCB) is a data structure associated with a process. It contains or points to information such as the process’s identity, parent, priority, and resources it is holding.
Why are register values part of the process’s context?
Register values hold temporary variables during execution and are part of the process’s context. They need to be saved by the operating system in reserved memory during a context switch.
How does a simple processor handle multiple processes?
A simple processor can only run one process at a time. If a computer is running several processes simultaneously, it actually performs context switching, running one process for a short time before switching to another.
What is the purpose of context switching?
Context switching allows a computer to allocate processor time to different processes. It involves saving the context of the currently running process and restoring the context of the next process to be executed.
What is the impact of a busy system on a favourite process?
In a busy system, a favourite process may perceptibly slow down as it gets a lesser share of processor time. Context switching between multiple processes takes place rapidly, but heavy load can affect individual process performance.
What components are included in a process’s full context?
A process’s full context includes the state held within the processor (registers, etc.), the memory management page tables, a list of owned resources, and any specific cached information such as the level-1 virtual cache and TLB contents.
What is the purpose of a control block in an operating system?
The control block, also known as a Process Control Block (PCB), is the operating system’s definition of a process. It holds information about a process, such as its identifier (PID) and priority.
What information is stored in a PCB?
A PCB holds or points to various parts of a process’s context that are preserved when the process is not actively running. This may include register values, memory allocation, opened files, and ownership of I/O devices.
What determines the specific details stored in a PCB?
The specific details stored in a PCB depend on the particular operating system. Different operating systems may store different information in the PCB based on their design and requirements.
How are PCBs typically organized in an operating system?
A typical implementation of a PCB includes one or more links that can point to other PCBs. This allows them to be assembled into linked lists, making it convenient to form queues, such as the ready queue of processes waiting to run on the processor.
What is the PCB an example of?
The PCB is an example of metadata in an operating system. It serves as descriptive information about a process, providing essential details for the operating system to manage and schedule processes effectively.
What is the purpose of a scheduler in an operating system?
The scheduler is responsible for deciding which process(es) to run at any given time in a multi-tasking operating system.