1. Home
Operating System

OS Tutorial: Learn Operating Systems Basics

Learn Operating System fundamentals: concepts, processes, memory management, and more. Start your journey to mastering OS with our comprehensive tutorial.

  • 47
  • 7 Hours
right-top-arrow

Tutorial Playlist

47 Lessons
12

Process in Operating System

Updated on 19/07/202497 Views

Have you ever contemplated the inner workings of your computer? How does it manage various jobs at once, ensuring a smooth user experience? 

The key component of the whole architecture that allows the operating system to navigate multiple tasks and activities is the process in operating system. 

Being a tech person who is very interested in everything about computer science and everything therein, I have always found the internal mechanisms of operating systems fascinating. And among these parts, a process in operating system is like the main character. 

So now, let's get ready and go together to explore process mysteries in operating systems!

What Is a Process in Operating System?

To define process in operating system, we can say that it is like a program running on a computer. This includes program code, data, and system resources assigned to it by the OS. Every process has its own identity called Process ID (PID). 

Components of Process in OS

Now that we have understood the process concept in operating system, let’s look at some more important details about the process in operating system.

A process in operating system is a running instance of a program. This process has many different parts that work together to make it functional and allow the program to run efficiently within the operating system environment. A process typically includes the following components:

  1. Program code: It's the program's executable code, including instructions for the process to follow.
  1. Data: Processes work with data, which can be variables, buffers, and other memory structures that the program uses.
  1. Process stack: The process stack keeps temporary data, for example, function parameters, return addresses, and local variables.
  1. Heap: The heap refers to the memory space that a process sets aside during its execution. This area is used for dynamically allocating data structures and objects.
  1. Process control block (PCB): The operating system maintains a data structure called a PCB for every process. It holds details like the process state, program counter, registers, and other metadata of that particular process.

What are Process States in Operating System?

A process, during its lifetime in an operating system, can be found in different states. Knowing about these process states in operating system is very important for managing the process well. 

  1. New: When a process in OS is just created, it enters into the state of new. In this state, the process gets ready for running and its PCB starts being initialized.
  1. Ready: A process that has been prepared to execute moves into the ready state. Here, it is patiently waiting for a CPU to be given to it so that it can run.
  1. Running: A process that is being executed by the CPU is in the running state. In this stage, the actual work of a process in operating system happens.
  1. Waiting (or Blocked): When a process is waiting for an event or resource, such as the completion of an I/O operation or a signal from another process, it shifts into the waiting state. The process stays in this position until that particular event or resource becomes possible.
  1. Terminated: A process in operating system that has finished its execution or been ended by the operating system is in the terminated state. In this situation, all resources previously assigned to it are freed up and its PCB gets taken out of the system.

The process management in windows operating system, or process management in general, and scheduling are built on these process states in operating system. The system moves processes through these states to make sure that it uses the resources of the system well and allows for smooth multitasking.

Types of Process in OS

A process in operating system can be categorized as follows: 

  1. Foreground process: Interactive processes, also referred to as foreground processes, are started and managed by users through a user interface. These processes have direct contact with the user and need user input to advance.
  1. Background process: These are processes that operate independently without any need for user interaction. They usually take care of tasks in the background, like system upkeep, observation, or batch processing.
  1. Real-time process: It is a process that must meet tight timing limits and due dates. These are applied in systems needing definite behavior and quick reply periods, like industrial control systems or multimedia apps.
  1. System process: System processes are crucial elements of the operating system. They handle tasks at the system level, like managing memory, device drivers, or system services.
  1. Child process: When a process in operating system gives birth to another process during its running, the fresh process that gets formed is known as child. The primary one becomes a parent procedure and some features are passed down to the offspring from their parents.

Knowing the various types of process in OS aids to create and improve system actions according to particular demands and limits.

Process Control in OS

Process control in OS means managing and keeping control of the executing operations of a process by the operating system. It encompasses different actions and features that make sure the smooth management of processes happens, maintaining stability within the system. Some main parts are:

  1. Process creation: The operating system's role in this step is to offer system calls or APIs that enable us to make new processes. It does this by providing a process control block (PCB) and allocating required resources for the fresh process. It also sets up an execution environment for it, which includes things like loading initial program instructions into memory and preparing necessary data structures.
  1. Process termination: Processes might decide to terminate on their own when they finish running, or an operating system could forcefully end a process because of mistakes in the program's code, lack of resources such as memory or CPU time, and user demands.
  1. Process scheduling: The scheduler of the operating system makes the choice about which procedure should run next according to its scheduling algorithms and priority of processes. It ensures that time for CPU is given fairly to each process.
  1. Inter-process communication (IPC): Processes usually need to exchange information and coordinate actions with each other. The operating system has IPC methods like pipes, shared memory or message passing that help in this communication between processes.
  1. Process synchronization: When many processes use shared resources, the OS uses methods like locks, semaphores or monitors to avoid race conditions and keep data consistent.

Process control in OS is extremely important for keeping system stability, resource use, and overall performance in check.

Process Management in Operating System

Process management in operating system is about handling and organizing processes throughout their life. These are some main points about how the management of processes works in an operating system, which is important for you to keep in mind before you can start understanding process management in OS example:

  1. Process scheduling: The scheduler within the operating system makes decisions about which process should be run at a given time. It uses various algorithms for scheduling, such as round-robin, priority-based, or multilevel queue scheduling, to fairly distribute and use CPU time among processes.
  1. Memory management: For the execution of processes, memory is needed, and the operating system deals with giving out and taking back memory resources. It uses methods such as virtual memory, paging, and segmentation to make better use of memory and give each process its own separate area in memory.
  1. Resource allocation: Processes need different system resources, like CPU time, memory, I/O devices, and files. The operating system handles giving out and taking back these resources from processes to ensure they share them fairly and effectively.
  1. Process monitoring: The operating system watches over the process as it runs, making sure that it behaves correctly and recognizing any oddities or mistakes. It gathers data and details about how well the process is doing, what resources are being utilized, and events within the system for study and improvement purposes.
  1. Process synchronization and communication: Processes use the operating system's methods to synchronize their actions and interact with other processes. The methods of inter-process communication and coordination include semaphores, message passing, shared memory or other similar techniques.

To show process management in operating system example, we can take the case of process management in Windows operating system. In Windows, process management is done using a priority-based preemptive scheduling algorithm. It gives priorities to processes depending on how important and interactive they are, and the scheduler makes sure that higher-priority processes get more CPU time. Windows also uses virtual memory management. This means that every process has its private virtual address space, and the operating system assigns physical memory to virtual addresses when required by the process.

For those looking to dive deeper into the technicalities of these topics, I recommend you check out upGrad’s course offerings. These courses are designed to cater to both freshers and experienced professionals. 

Wrapping Up

In this tutorial, we have understood more about the interesting area of processes in operating systems. We have learned what a process is and its parts, looked at different states and kinds of processes, as well as talked about methods for controlling and handling them.

When you start your journey to becoming an operating system expert, keep in mind that processes are only a part of the whole picture. To really shine in this area, it is important for you to have a complete comprehension of operating system ideas such as managing memory, handling files and directories, device control, etc.

If your enthusiasm for learning is pushing you to explore more about operating systems, then I suggest checking out the technical courses available at upGrad. From computer science to software engineering and other related fields, upGrad offers a variety of in-depth learning routes that can help you become knowledgeable about the details involved with designing and creating operating systems.

FAQs

  1. What is a process in an operating system?

In an operating system, a process is like a program running. It has program code, data and system resources given by the operating system. It's the smallest part of work that can be handled and planned by the operating system.

  1. What are the main components of a process?

The primary parts of a process are program code, data, process stack, heap, and process control block (PCB). All these components interact to make running and functioning the process possible.

  1. What is process scheduling?

Process scheduling handles the order of execution for processes in use by the operating system. It gives time for the CPU to process according to priority and scheduling algorithms. This makes sure that all system resources are used fairly and effectively.

  1. What are the different states of a process?

The states that a process has in an operating system are new, ready, running, waiting (or blocked), and terminated. These different phases show how a process changes from being made to ending its life cycle.

  1. What is the process with an example?

A process is a running instance of a program. If you open a web browser on your computer, it becomes a process. The browser's process includes its executable code, data, and system resources assigned to it. It carries out tasks like showing web pages or managing interactions with users.

  1. What is the process table in the OS?

A process table is a data structure in an operating system that holds information about each and every process being handled by the system. It has entries for process IDs, states of processes, program counters, and other metadata needed for managing and scheduling processes.

  1. How does a process communicate with other processes?

Processes can talk to each other using inter-process communication (IPC) methods provided by operating systems. These methods include pipes, shared memory, message sending and receiving, and signals—all within the IPC range for being understood by different processes. Using IPC allows processes to swap data with each other or coordinate their actions and timing in a synchronized way.

  1. What is process synchronization?

Synchronization in process means the methods and tools employed to align activities of many processes, particularly when they are interacting with common resources. This guarantees that processes get into shared data or resources one after another and in a synchronized way, making sure there is no race condition while maintaining data uniformity.

Pavan Vadapalli

Pavan Vadapalli

Motivated to leverage technology to solve problems. Seasoned leader for startups and fast moving orgs. Working on solving problems of scale and l…Read More

Get Free Career Counselling
form image
+91
*
By clicking, I accept theT&Cand
Privacy Policy
image
Join 10M+ Learners & Transform Your Career
Learn on a personalised AI-powered platform that offers best-in-class content, live sessions & mentorship from leading industry experts.
right-top-arrowleft-top-arrow

upGrad Learner Support

Talk to our experts. We’re available 24/7.

text

Indian Nationals

1800 210 2020

text

Foreign Nationals

+918045604032

Disclaimer

upGrad does not grant credit; credits are granted, accepted or transferred at the sole discretion of the relevant educational institution offering the diploma or degree. We advise you to enquire further regarding the suitability of this program for your academic, professional requirements and job prospects before enr...