Master this deck with 23 terms through effective study methods.
Generated from uploaded pdf
A process is a program in execution, which includes the program code and its current activity. It is an instance of a running program.
When a program is loaded into memory and executed by the CPU, it becomes a process. For example, opening Firefox transforms it from a program into a process.
When a process is closed, it stops executing and is terminated, releasing any resources it was using.
Each process has a unique Process Identifier (PID), a Parent Process Identifier (PPID), a User Identifier (UID), and a Group Identifier (GID).
The PCB is a data structure that contains all the information about a process, including its state, PID, PPID, priority, memory usage, and open files, allowing the operating system to manage the process effectively.
A process can be in several states: New, Ready, Running, Waiting, and Terminated. Each state represents a different stage in the lifecycle of a process.
The fork() system call is used to create a new process by duplicating the existing process, resulting in a parent-child relationship.
The exec() system call replaces the current process image with a new process image, effectively running a different program within the same process.
The exit() system call is used to terminate a process and signal its completion to the operating system.
The wait() system call allows a parent process to wait for its child process to finish execution and retrieve its exit status.
The ps command displays a list of currently running processes, including their PID, terminal (TTY), CPU time (TIME), and command name (CMD).
The -f option provides a full-format listing of processes, showing detailed information such as UID, PID, PPID, and the command line that started the process.
Managing process states is crucial for efficient CPU utilization, resource allocation, and ensuring that processes are executed in a timely manner.
The address space of a process is the range of memory addresses that the process can use during its execution, typically divided into segments such as code, data, and stack.
The code segment contains the executable instructions of the program, which are loaded into memory and executed by the CPU.
The data segment holds global and static variables that are used by the program during its execution.
The stack segment is used for dynamic memory allocation, storing local variables, function parameters, and return addresses during function calls.
The operating system maintains a table of processes, where each entry corresponds to a PCB, allowing it to manage and schedule processes effectively.
The priority of a process determines the order in which processes are scheduled for execution, influencing the responsiveness and performance of the system.
When a process is in the waiting state, it is not currently executing and is waiting for some event to occur, such as the completion of I/O operations.
A parent process is the original process that creates one or more child processes using the fork() system call. Child processes inherit certain attributes from their parent.
Unique identifiers for processes (PID, PPID) are necessary to distinguish between multiple processes running simultaneously, allowing the operating system to manage them effectively.
When a process terminates, the operating system cleans up resources, updates the PCB, and may notify the parent process of the child's exit status.