

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of process management within operating systems. It covers key concepts such as process definition, process control blocks (pcbs), process states, and state transitions. It also explains process creation, termination, and scheduling, including the roles of long-term and short-term schedulers. The document further details context switching, interrupt handling, and time-sharing systems, offering a comprehensive understanding of how operating systems manage processes to ensure efficient resource utilization and system performance. It is a valuable resource for students and professionals seeking to understand the fundamental principles of process management in modern computing environments. A valuable resource for students and professionals seeking to understand the fundamental principles of process management in modern computing environments.
Typology: Summaries
1 / 3
This page cannot be seen from the preview
Don't miss anything!


A process is an instance of a program in execution. Multiple instances of the same program are considered distinct processes. The operating system allocates resources to a process during its execution. These resources include CPU time, memory space for code, data, and stack, open files, signals, and data structures to maintain process information. Each process is identified by a unique, positive integer ID, known as the process ID.
The PCB is the primary data structure maintained by the OS, containing information about a process. There is one PCB per process, and the OS maintains a list of PCBs for all processes. Typical contents of a PCB include the process ID, parent process ID, process state, CPU state (CPU register contents, PSW), priority and other scheduling information, pointers to different memory areas, open file information, signals and signal handler information, and various accounting information like CPU time used. Linux PCBs (task_struct) can have over 100 fields.
A process transitions through different states as it executes. These states are: * new: The process is being created. * running: Instructions are being executed. * waiting: The process is waiting for some event to occur. * ready: The process is waiting to be assigned to a CPU. * terminated: The process has finished execution.
The main operations performed on a process include: * Process creation: Data structures like the PCB are set up and initialized. Initial resources are allocated and initialized if needed. The process is added to the ready queue.
A process can create another process by making a system call (e.g., fork()). The process that invokes the call is the parent process, and the new process created is the child process. The new process can, in turn, create other processes, forming a tree of processes. The first process in the system is handcrafted because the OS is not fully running. Resource sharing possibilities include: parent and children share all resources, children share a subset of parent’s resources, or parent and child share no resources. Execution possibilities include: parent and children execute concurrently, or the parent waits until children terminate. Memory address space possibilities include: the address space of the child is a duplicate of the parent, or the child has a new program loaded into it.
A process terminates when it executes its last statement and asks the operating system to terminate it (e.g., exit/abort), or when it encounters a fatal error (e.g., arithmetic exception). The parent may terminate the execution of child processes (e.g., kill) if the child has exceeded allocated resources, the task assigned to the child is no longer required, or the parent is exiting. Some operating systems may not allow a child to continue if its parent terminates.
The ready queue is a queue of all processes residing in main memory, ready and waiting to execute (links to PCBs). The scheduler/dispatcher picks up a process from the ready queue according to some algorithm (CPU Scheduling Policy) and assigns it the CPU. The selected process runs until it needs to wait for some event to occur (e.g., a disk read), the CPU scheduling policy dictates that it be stopped, the CPU time allotted to it expires (timesharing systems), or a higher priority process arrives. When it is ready to run again, it goes back to the ready queue. The scheduler is invoked again to select the next process from the ready queue.
The long-term scheduler (or job scheduler) selects which processes should be brought into the ready queue and controls the degree of multiprogramming (number of jobs in memory). It is invoked infrequently (seconds, minutes) and may not be present in an OS (e.g., Linux/Windows). The short-term scheduler (or CPU scheduler) selects which process should be executed next and allocates the CPU. It is invoked very frequently (milliseconds) and must be fast. If all processes do not fit in memory, partially executed jobs can be swapped out to secondary memory and brought back in later. Medium-term scheduling involves copying the process image to a designated area on the disk (swap out) and bringing it back into the ready queue later.