1 of 12

Cardamom Planters’ association College, BODINAYAKANUR

Presented By

M.Neya Shree M.Sc.,

Guest Lecturer,

Department of CS &IT.

OPERATING SYSTEM

PROCESS MANAGEMENT

2 of 12

Process Management

  • It is an important part of the operating system. It allows you to control the way your computer runs by managing the currently active processes.

  • This includes ending processes that are no longer needed, setting process priorities, and more. You can do it on your computer also.

  • There are a few ways to manage your processes. The first is through the use of Task Manager. This allows you to see all of the processes currently running on your computer and their current status and CPU/memory usage.

  • You can end any process that you no longer need, set a process priority, or start or stop a service.

3 of 12

The process management are divided into five. They are,

  • State Process
  • Process control Block
  • Process Operation
  • Suspend And Resume
  • Context Switching

4 of 12

State Process

  • A process is a program in execution and it is more than a program code called as text section. The process executes when it changes the state. The state of a process is defined by the current activity of the process.
  • Each process may be in any one of the following states−

 New−The process is being created.

 Running−In this state the instructions are being executed.

 Waiting −The process is in waiting state until an event occurs like I/O operation completion or receiving a signal.

 Ready−The process is waiting to be assigned to a processor.

 Terminated−The process has finished execution.

5 of 12

6 of 12

Process Control Block

  • A Process Control Block (PCB) is a data structure used by the operating system to manage information about a process.
  • The process control keeps track of many important pieces of information needed to manage processes efficiently.

7 of 12

The following are the data items

Process State

  • This specifies the process state i.e. new, ready, running, waiting or terminated.

Process Identification Number

  • This shows the number of the particular process.

Program Counter

  • This contains the address of the next instruction that needs to be executed in the process.

Registers

  • This specifies the registers that are used by the process. They may include accumulators, index registers, stack pointers, general purpose registers etc.

8 of 12

Process operations

  • Process operations in an operating system (OS) refer to the actions and activities performed on processes to manage their creation execution, and termination, ensuring efficient and coordinated resource utilization.
  • These operations are crucial for a multi-programming environment where multiple programs can run concurrently.

Key Process Operations:

Process Creation:

The OS creates new processes, assigning them unique identifiers and allocating necessary resources.

Scheduling:

The OS determines the order in which processes are executed, ensuring fair access

to the CPU.

9 of 12

Termination:

When a process completes its execution or encounters an error, the OS terminates it, releasing the allocated resources.

Resource Management:

The OS manages and allocates resources like memory, I/O devices, and files to

processes, ensuring they have what they need.

Synchronization:

The OS coordinates the execution of multiple processes to prevent race conditions and ensure data integrity when accessing shared resources.

Communication:

The OS provides mechanisms for processes to communicate with each other,

enabling collaboration and information sharing.

Deadlock Handling:

The OS detects and resolves situations where multiple processes are stuck waiting for each other, preventing a system-wide freeze.

10 of 12

Suspend and Resume

Suspend:

  • When you suspend the system, the OS saves the current state of all running

applications, open files, and system settings to memory (RAM) or disk. The system

then enters a low-power state, potentially powering down some peripherals and slowing down the CPU.

Resume:

  • When you resume, the OS retrieves the saved state from memory or disk and

restores everything to its previous condition.

11 of 12

Key Benefits

  • Time-saving: Avoids the lengthy process of shutting down and restarting the system. 
  • Convenience: Allows you to pick up where you left off without losing your work. 
  • Power management: Provides a way to conserve energy by reducing power
  • consumption when the system is not actively in use. 

Examples:

Manual Suspension: Many operating systems allow you to initiate suspend through a

menu option, a power button press, or a keyboard shortcut (e.g., Shift + Power). 

Automatic Suspension: Some systems can automatically suspend after a period of

inactivity. 

Suspend/Resume on Cloud Instances: Cloud providers like Google Cloud allow you to suspend and resume virtual machines (VMs), which can be useful for cost optimization

and resource management.

12 of 12

Context Switching

  • Context Switching in an operating system is a critical function that allows the CPU to efficiently manage multiple processes.
  • By saving the state of a currently active process and loading the state of another, the system can handle various tasks simultaneously without losing progress.
  • This switching mechanism ensures optimal use of the CPU, enhancing the system's ability to perform multitasking effectively.

Example of Context Switching:

  • Suppose the operating system has (N) processes stored in a Process Control Block (PCB). Each process runs using the CPU to perform its task.
  • While a process is running, other processes with higher priorities queue up to use the CPU and complete their tasks.
  • Switching the CPU to another process requires saving the state of the current process and restoring the state of a different process. This task is known as a context switch.