PDF Notes: gestion processus

    Master this deck with 23 terms through effective study methods.

    Generated from uploaded pdf

    Created by @lias

    What is a process in computing?

    A process is a program in execution, which includes the program code and its current activity. It is an instance of a running program.

    How does a program become a process?

    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.

    What happens to a process when it is closed?

    When a process is closed, it stops executing and is terminated, releasing any resources it was using.

    What are the key identifiers associated with a process?

    Each process has a unique Process Identifier (PID), a Parent Process Identifier (PPID), a User Identifier (UID), and a Group Identifier (GID).

    What is the significance of the Process Control Block (PCB)?

    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.

    What are the different states a process can be in?

    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.

    What is the role of the fork() system call?

    The fork() system call is used to create a new process by duplicating the existing process, resulting in a parent-child relationship.

    What does the exec() system call do?

    The exec() system call replaces the current process image with a new process image, effectively running a different program within the same process.

    What is the purpose of the exit() system call?

    The exit() system call is used to terminate a process and signal its completion to the operating system.

    How does the wait() system call function?

    The wait() system call allows a parent process to wait for its child process to finish execution and retrieve its exit status.

    What information does the ps command provide?

    The ps command displays a list of currently running processes, including their PID, terminal (TTY), CPU time (TIME), and command name (CMD).

    What does the -f option do when used with the ps command?

    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.

    Why is it important to manage process states?

    Managing process states is crucial for efficient CPU utilization, resource allocation, and ensuring that processes are executed in a timely manner.

    What is the address space of a process?

    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.

    What does the code segment of a process contain?

    The code segment contains the executable instructions of the program, which are loaded into memory and executed by the CPU.

    What is the role of the data segment in a process?

    The data segment holds global and static variables that are used by the program during its execution.

    What is the stack segment in a process?

    The stack segment is used for dynamic memory allocation, storing local variables, function parameters, and return addresses during function calls.

    How does the operating system keep track of processes?

    The operating system maintains a table of processes, where each entry corresponds to a PCB, allowing it to manage and schedule processes effectively.

    What is the significance of the priority of a process?

    The priority of a process determines the order in which processes are scheduled for execution, influencing the responsiveness and performance of the system.

    What happens when a process is in the waiting state?

    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.

    What is the difference between a parent process and a child process?

    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.

    Why is it necessary to have unique identifiers for processes?

    Unique identifiers for processes (PID, PPID) are necessary to distinguish between multiple processes running simultaneously, allowing the operating system to manage them effectively.

    How does the operating system handle process termination?

    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.