Partielo | Créer ta fiche de révision en ligne rapidement
College or University

OS

Generation of Operating System

Below are four generations of operating systems.

  • The First Generation
  • The Second Generation
  • The Third Generation
  • The Fourth Generation

1. The First Generation (1940 to early 1950s)

In 1940, an operating system was not included in the creation of the first electrical computer. Early computer users had complete control over the device and wrote programs in pure machine language for every task. During the computer generation, a programmer can merely execute and solve basic mathematical calculations. an operating system is not needed for these computations.

2. The Second Generation (1955 – 1965)

GMOSIS, the first operating system (OS) was developed in the early 1950s. For the IBM Computer, General Motors has created the operating system. Because it gathers all related jobs into groups or batches and then submits them to the operating system using a punch card to finish all of them, the second-generation operating system was built on a single-stream batch processing system.

3. The Third Generation (1965 – 1980)

Because it gathers all similar jobs into groups or batches and then submits them to the second generation operating system using a punch card to finish all jobs in a machine, the second-generation operating system was based on a single stream batch processing system. Control is transferred to the operating system upon each job’s completion, whether it be routinely or unexpectedly. The operating system cleans up after each work is finished before reading and starting the subsequent job on a punch card. Large, professionally operated machines known as mainframes were introduced after that. Operating system designers were able to create a new operating system in the late 1960s that was capable of multiprogramming—the simultaneous execution of several tasks in a single computer program.

In order to create operating systems that enable a CPU to be active at all times by carrying out multiple jobs on a computer at once, multiprogramming has to be introduced. With the release of the DEC PDP-1 in 1961, the third generation of minicomputers saw a new phase of growth and development.

4. The Fourth Generation (1980 – Present Day)

The fourth generation of personal computers is the result of these PDPs. The Generation IV (1980–Present)The evolution of the personal computer is linked to the fourth generation of operating systems. Nonetheless, the third-generation minicomputers and the personal computer have many similarities. At that time, minicomputers were only slightly more expensive than personal computers, which were highly expensive.

The development of Microsoft and the Windows operating system was a significant influence in the creation of personal computers. In 1975, Microsoft developed the first Windows operating system. Bill Gates and Paul Allen had the idea to advance personal computers after releasing the Microsoft Windows OS. As a result, the MS-DOS was released in 1981, but users found it extremely challenging to decipher its complex commands. Windows is now the most widely used and well-liked operating system available. Following then, Windows released a number of operating systems, including Windows 95, Windows 98, Windows XP, and Windows 7, the most recent operating system. The majority of Windows users are currently running Windows 10. Apple is another well-known operating system in addition to Windows.

Types of Operating System

Operating Systems have evolved in past years. It went through several changes before getting its original form. These changes in the operating system are known as the evolution of operating systems. OS improve itself with the invention of new technology. Basically , OS added the feature of new technology and making itself more powerful. Let us see the evolution of operating system year-wise in detail:

  • No OS – (0s to 1940s)
  • Batch Processing Systems -(1940s to 1950s)
  • Multiprogramming Systems -(1950s to 1960s)
  • Time-Sharing Systems -(1960s to 1970s)
  • Introduction of GUI -(1970s to 1980s)
  • Networked Systems – (1980s to 1990s)
  • Mobile Operating Systems – (Late 1990s to Early 2000s)
  • AI Integration – (2010s to ongoing)

1. No OS – (0s to 1940s)

As we know that before 1940s, there was no use of OS . Earlier, people are lacking OS in their computer system so they had to manually type instructions for each tasks in machine language(0-1 based language) . And at that time , it was very hard for users to implement even a simple task. And it was very time consuming and also not user-friendly . Because not everyone had that much level of understanding to understand the machine language and it required a deep understanding.

2. Batch Processing Systems -(1940s to 1950s)

With the growth of time, batch processing system came into the market .Now Users had facility to write their programs on punch cards and load it to the computer operator. And then operator make different batches of similar types of jobs and then serve the different batch(group of jobs) one by one to the CPU .CPU first executes jobs of one batch and them jump to the jobs of other batch in a sequence manner.

3. Multiprogramming Systems -(1950s to 1960s)

Multiprogramming was the first operating system where actual revolution began. It provide user facility to load the multiple program into the memory and provide a specific portion of memory to each program. When one program is waiting for any I/O operations (which take much time) at that time the OS give permission to CPU to switch from previous program to other program(which is first in ready queue) for continuous execution of program with interrupt.

4. Time-Sharing Systems -(1960s to 1970s)

Time-sharing systems is extended version of multiprogramming system. Here one extra feature was added to avoid the use of CPU for long time by any single program and give access of CPU to every program after a certain interval of time. Basically OS switches from one program to another program after a certain interval of time so that every program can get access of CPU and complete their work.

5. Introduction of GUI -(1970s to 1980s)

With the growth of time, Graphical User Interfaces (GUIs) came. First time OS became more user-friendly and changed the way of people to interact with computer. GUI provides computer system visual elements which made user’s interaction with computer more comfortable and user-friendly. User can just click on visual elements rather than typing commands. Here are some feature of GUI in Microsoft’s windows icons, menus and windows.

6. Networked Systems – (1980s to 1990s)

At 1980s,the craze of computer networks at it’s peak .A special type of Operating Systems needed to manage the network communication . The OS like Novell NetWare and Windows NT were developed to manage network communication which provide users facility to work in collaborative environment and made file sharing and remote access very easy.

7. Mobile Operating Systems – (Late 1990s to Early 2000s)

Invention of smartphones create a big revolution in software industry, To handle the operation of smartphones , a special type of operating systems were developed. Some of them are : iOS and Android etc. These operating systems were optimized with the time and became more powerful.

What is Process Management?

Process management is a key part of an operating system. It controls how processes are carried out, and controls how your computer runs by handling the active processes. This includes stopping processes, setting which processes should get more attention, and many more. You can manage processes on your own computer too.

States of Process

A process is in one of the following states: 

  • New: Newly Created Process (or) being-created process.
  • Ready: After the creation process moves to the Ready state, i.e. the process is ready for execution.
  • Running: Currently running process in CPU (only one process at a time can be under execution in a single processor).
  • Wait (or Block): When a process requests I/O access.
  • Complete (or Terminated): The process completed its execution.
  • Suspended Ready: When the ready queue becomes full, some processes are moved to a suspended ready state
  • Suspended Block: When the waiting queue becomes full.

The Long-Term Scheduler, also known as the Job Scheduler, is an operating system component responsible for selecting processes from the job queue and loading them into the main memory for execution. This scheduler operates at a slower pace, as it controls the degree of multiprogramming by selecting processes less frequently. It plays a crucial role in determining the mix of input/output-bound and CPU-bound processes to optimize system performance. The Long-Term Scheduler is always present in Batch Operating Systems and may or may not be present in Time-Sharing Operating Systems.

On the other hand, the Short-Term Scheduler, also referred to as the CPU Scheduler, selects processes from the ready queue to be executed by the processor. This scheduler operates at a faster pace, choosing processes more frequently and providing less control over the degree of multiprogramming. It is always present in Batch Operating Systems and is minimally present in Time-Sharing Operating Systems. The Short-Term Scheduler's primary function is to frequently select new processes for the processor, ensuring efficient CPU utilization.


Interprocess communication is the mechanism provided by the operating system that allows processes to communicate with each other. This communication could involve a process letting another process know that some event has occurred or the transferring of data from one process to another

different approaches to implement interprocess communication are given as follows −

  • Pipe
  • A pipe is a data channel that is unidirectional. Two pipes can be used to create a two-way data channel between two processes. This uses standard input and output methods. Pipes are used in all POSIX systems as well as Windows operating systems.
  • Socket
  • The socket is the endpoint for sending or receiving data in a network. This is true for data sent between processes on the same computer or data sent between different computers on the same network. Most of the operating systems use sockets for interprocess communication.
  • File
  • A file is a data record that may be stored on a disk or acquired on demand by a file server. Multiple processes can access a file as required. All operating systems use files for data storage.
  • Signal
  • Signals are useful in interprocess communication in a limited way. They are system messages that are sent from one process to another. Normally, signals are not used to transfer data but are used for remote commands between processes.
  • Shared Memory
  • Shared memory is the memory that can be simultaneously accessed by multiple processes. This is done so that the processes can communicate with each other. All POSIX systems, as well as Windows operating systems use shared memory.
  • Message Queue
  • Multiple processes can read and write data to the message queue without being connected to each other. Messages are stored in the queue until their recipient retrieves them. Message queues are quite useful for interprocess communication and are used by most operating systems.

Multithreading is a programming and execution model that allows multiple threads to exist within the context of a single process. These threads share the process's resources but can execute independently. This approach is used to perform multiple operations concurrently within the same program.

Advantages of Multithreading

  1. Increased Responsiveness:
  • In a multithreaded application, the execution of a heavy task can occur in the background while the main thread continues to respond to user inputs. This makes the application more responsive.
  1. Resource Sharing:
  • Threads within the same process share the same memory space and resources, which reduces the overhead associated with creating and managing separate processes.
  1. Improved Performance:
  • On multi-core or multi-processor systems, multithreading can lead to better utilization of CPU resources, allowing different threads to run on different cores simultaneously, thus speeding up execution.
  1. Simplified Coding of Concurrent Systems:
  • Multithreading simplifies the development of programs that perform multiple tasks at once, such as web servers handling multiple connections or user interfaces updating while performing background calculations.

What is Preemptive Scheduling?

Preemptive scheduling is used when a process switches from the running state to the ready state or from the waiting state to the ready state. The resources (mainly CPU cycles) are allocated to the process for a limited amount of time and then taken away, and the process is again placed back in the ready queue if that process still has CPU burst time remaining. That process stays in the ready queue till it gets its next chance to execute. 



What is Non-Preemptive Scheduling?

Non-preemptive Scheduling is used when a process terminates, or a process switches from running to the waiting state. In this scheduling, once the resources (CPU cycles) are allocated to a process, the process holds the CPU till it gets terminated or reaches a waiting state. In the case of non-preemptive scheduling does not interrupt a process running CPU in the middle of the execution. Instead, it waits till the process completes its CPU burst time, and then it can allocate the CPU to another process. 


Deadlock Prevention in operating systems involves strategies to ensure that at least one of the necessary conditions for deadlock does not hold. Here are the main techniques used to prevent deadlocks:

  1. Mutual Exclusion:
  • Ensure that resources that cannot be shared are not held by multiple processes simultaneously. For non-shareable resources like printers, techniques like spooling (queuing requests) can be used to avoid conflicts​ (Scaler)​.
  1. Hold and Wait:
  • Processes must either request all required resources at once before execution starts or release all held resources before requesting new ones. This prevents processes from holding some resources while waiting for others, thus avoiding deadlock scenarios​ (Scaler)​.
  1. No Preemption:
  • If a process holding resources is unable to obtain additional resources, it must release its current resources and request them again. Alternatively, higher-priority processes can preempt resources from lower-priority processes, which can then re-request the resources later​ (Scaler)​.
  1. Circular Wait:
  • Impose an ordering of resource types and require processes to request resources in a particular sequence, ensuring that circular waiting conditions cannot occur. For example, if resources are numbered, a process must request resources in increasing order of their numbers​ (Scaler)​​ (www.javatpoint.com)​.

The Banker’s Algorithm is a resource allocation and deadlock avoidance algorithm that tests for safety by simulating the allocation for the predetermined maximum possible amounts of all resources, then makes an “s-state” check to test for possible activities, before deciding whether allocation should be allowed to continue.

The Banker’s Algorithm is a smart way for computer systems to manage how programs use resources, like memory or CPU time. It helps prevent situations where programs get stuck and can’t finish their tasks, which is called deadlock. By keeping track of what resources each program needs and what’s available, the algorithm makes sure that programs only get what they need in a safe order. 


The Banker's Algorithm is a deadlock avoidance method used in operating systems to manage resource allocation. It works by ensuring that a system only allocates resources in a way that will leave it in a safe state. This means that the system can allocate resources to each process in some order and still avoid deadlock.

Key Concepts

  1. Available: A vector that represents the number of available instances of each resource type.
  2. Max: A matrix indicating the maximum demand of each process.
  3. Allocation: A matrix indicating the number of resources currently allocated to each process.
  4. Need: A matrix representing the remaining resource needs of each process, calculated as Need[i][j] = Max[i][j] - Allocation[i][j].

Steps of the Banker's Algorithm

  1. Resource Request Algorithm: When a process requests resources, the system checks if the request can be granted while keeping the system in a safe state:
  • Check if the request is less than or equal to the need.
  • Check if the request is less than or equal to the available resources.
  • Provisionally allocate the resources and update the matrices.
  1. Safety Algorithm: Determines if the system is in a safe state after the provisional allocation:
  • Initialize the Work vector with the available resources.
  • Find a process whose resource needs can be satisfied with the current Work vector and mark it as finished.
  • If all processes can be marked as finished, the system is in a safe state.


Swapping is the process of bringing a process into memory and then temporarily copying it to the disc after it has run for a while. The purpose of swapping in an operating system is to access data on a hard disc and move it to RAM so that application programs can use it. It’s important to remember that swapping is only used when data isn’t available in RAM. Although the swapping process degrades system performance, it allows larger and multiple processes to run concurrently. Because of this, swapping is also known as memory compaction. The CPU scheduler determines which processes are swapped in and which are swapped out. Consider a multiprogramming environment that employs a priority-based scheduling algorithm. When a high-priority process enters the input queue, a low-priority process is swapped out so the high-priority process can be loaded and executed. When this process terminates, the low priority process is swapped back into memory to continue its execution

Paging is a memory management scheme that eliminates the need for a contiguous allocation of physical memory. The process of retrieving processes in the form of pages from the secondary storage into the main memory is known as paging. The basic purpose of paging is to separate each procedure into pages. Additionally, frames will be used to split the main memory. This scheme permits the physical address space of a process to be non – contiguous.

In paging, the physical memory is divided into fixed-size blocks called page frames, which are the same size as the pages used by the process. The process’s logical address space is also divided into fixed-size blocks called pages, which are the same size as the page frames. When a process requests memory, the operating system allocates one or more page frames to the process and maps the process’s logical pages to the physical page frames.

The mapping between logical pages and physical page frames is maintained by the page table, which is used by the memory management unit to translate logical addresses into physical addresses. The page table maps each logical page number to a physical page frame number.


A process is divided into Segments. The chunks that a program is divided into which are not necessarily all of the exact sizes are called segments. Segmentation gives the user’s view of the process which paging does not provide. Here the user’s view is mapped to physical memory.

Types of Segmentation in Operating Systems

  • Virtual Memory Segmentation: Each process is divided into a number of segments, but the segmentation is not done all at once. This segmentation may or may not take place at the run time of the program.
  • Simple Segmentation: Each process is divided into a number of segments, all of which are loaded into memory at run time, though not necessarily contiguously.




College or University

OS

Generation of Operating System

Below are four generations of operating systems.

  • The First Generation
  • The Second Generation
  • The Third Generation
  • The Fourth Generation

1. The First Generation (1940 to early 1950s)

In 1940, an operating system was not included in the creation of the first electrical computer. Early computer users had complete control over the device and wrote programs in pure machine language for every task. During the computer generation, a programmer can merely execute and solve basic mathematical calculations. an operating system is not needed for these computations.

2. The Second Generation (1955 – 1965)

GMOSIS, the first operating system (OS) was developed in the early 1950s. For the IBM Computer, General Motors has created the operating system. Because it gathers all related jobs into groups or batches and then submits them to the operating system using a punch card to finish all of them, the second-generation operating system was built on a single-stream batch processing system.

3. The Third Generation (1965 – 1980)

Because it gathers all similar jobs into groups or batches and then submits them to the second generation operating system using a punch card to finish all jobs in a machine, the second-generation operating system was based on a single stream batch processing system. Control is transferred to the operating system upon each job’s completion, whether it be routinely or unexpectedly. The operating system cleans up after each work is finished before reading and starting the subsequent job on a punch card. Large, professionally operated machines known as mainframes were introduced after that. Operating system designers were able to create a new operating system in the late 1960s that was capable of multiprogramming—the simultaneous execution of several tasks in a single computer program.

In order to create operating systems that enable a CPU to be active at all times by carrying out multiple jobs on a computer at once, multiprogramming has to be introduced. With the release of the DEC PDP-1 in 1961, the third generation of minicomputers saw a new phase of growth and development.

4. The Fourth Generation (1980 – Present Day)

The fourth generation of personal computers is the result of these PDPs. The Generation IV (1980–Present)The evolution of the personal computer is linked to the fourth generation of operating systems. Nonetheless, the third-generation minicomputers and the personal computer have many similarities. At that time, minicomputers were only slightly more expensive than personal computers, which were highly expensive.

The development of Microsoft and the Windows operating system was a significant influence in the creation of personal computers. In 1975, Microsoft developed the first Windows operating system. Bill Gates and Paul Allen had the idea to advance personal computers after releasing the Microsoft Windows OS. As a result, the MS-DOS was released in 1981, but users found it extremely challenging to decipher its complex commands. Windows is now the most widely used and well-liked operating system available. Following then, Windows released a number of operating systems, including Windows 95, Windows 98, Windows XP, and Windows 7, the most recent operating system. The majority of Windows users are currently running Windows 10. Apple is another well-known operating system in addition to Windows.

Types of Operating System

Operating Systems have evolved in past years. It went through several changes before getting its original form. These changes in the operating system are known as the evolution of operating systems. OS improve itself with the invention of new technology. Basically , OS added the feature of new technology and making itself more powerful. Let us see the evolution of operating system year-wise in detail:

  • No OS – (0s to 1940s)
  • Batch Processing Systems -(1940s to 1950s)
  • Multiprogramming Systems -(1950s to 1960s)
  • Time-Sharing Systems -(1960s to 1970s)
  • Introduction of GUI -(1970s to 1980s)
  • Networked Systems – (1980s to 1990s)
  • Mobile Operating Systems – (Late 1990s to Early 2000s)
  • AI Integration – (2010s to ongoing)

1. No OS – (0s to 1940s)

As we know that before 1940s, there was no use of OS . Earlier, people are lacking OS in their computer system so they had to manually type instructions for each tasks in machine language(0-1 based language) . And at that time , it was very hard for users to implement even a simple task. And it was very time consuming and also not user-friendly . Because not everyone had that much level of understanding to understand the machine language and it required a deep understanding.

2. Batch Processing Systems -(1940s to 1950s)

With the growth of time, batch processing system came into the market .Now Users had facility to write their programs on punch cards and load it to the computer operator. And then operator make different batches of similar types of jobs and then serve the different batch(group of jobs) one by one to the CPU .CPU first executes jobs of one batch and them jump to the jobs of other batch in a sequence manner.

3. Multiprogramming Systems -(1950s to 1960s)

Multiprogramming was the first operating system where actual revolution began. It provide user facility to load the multiple program into the memory and provide a specific portion of memory to each program. When one program is waiting for any I/O operations (which take much time) at that time the OS give permission to CPU to switch from previous program to other program(which is first in ready queue) for continuous execution of program with interrupt.

4. Time-Sharing Systems -(1960s to 1970s)

Time-sharing systems is extended version of multiprogramming system. Here one extra feature was added to avoid the use of CPU for long time by any single program and give access of CPU to every program after a certain interval of time. Basically OS switches from one program to another program after a certain interval of time so that every program can get access of CPU and complete their work.

5. Introduction of GUI -(1970s to 1980s)

With the growth of time, Graphical User Interfaces (GUIs) came. First time OS became more user-friendly and changed the way of people to interact with computer. GUI provides computer system visual elements which made user’s interaction with computer more comfortable and user-friendly. User can just click on visual elements rather than typing commands. Here are some feature of GUI in Microsoft’s windows icons, menus and windows.

6. Networked Systems – (1980s to 1990s)

At 1980s,the craze of computer networks at it’s peak .A special type of Operating Systems needed to manage the network communication . The OS like Novell NetWare and Windows NT were developed to manage network communication which provide users facility to work in collaborative environment and made file sharing and remote access very easy.

7. Mobile Operating Systems – (Late 1990s to Early 2000s)

Invention of smartphones create a big revolution in software industry, To handle the operation of smartphones , a special type of operating systems were developed. Some of them are : iOS and Android etc. These operating systems were optimized with the time and became more powerful.

What is Process Management?

Process management is a key part of an operating system. It controls how processes are carried out, and controls how your computer runs by handling the active processes. This includes stopping processes, setting which processes should get more attention, and many more. You can manage processes on your own computer too.

States of Process

A process is in one of the following states: 

  • New: Newly Created Process (or) being-created process.
  • Ready: After the creation process moves to the Ready state, i.e. the process is ready for execution.
  • Running: Currently running process in CPU (only one process at a time can be under execution in a single processor).
  • Wait (or Block): When a process requests I/O access.
  • Complete (or Terminated): The process completed its execution.
  • Suspended Ready: When the ready queue becomes full, some processes are moved to a suspended ready state
  • Suspended Block: When the waiting queue becomes full.

The Long-Term Scheduler, also known as the Job Scheduler, is an operating system component responsible for selecting processes from the job queue and loading them into the main memory for execution. This scheduler operates at a slower pace, as it controls the degree of multiprogramming by selecting processes less frequently. It plays a crucial role in determining the mix of input/output-bound and CPU-bound processes to optimize system performance. The Long-Term Scheduler is always present in Batch Operating Systems and may or may not be present in Time-Sharing Operating Systems.

On the other hand, the Short-Term Scheduler, also referred to as the CPU Scheduler, selects processes from the ready queue to be executed by the processor. This scheduler operates at a faster pace, choosing processes more frequently and providing less control over the degree of multiprogramming. It is always present in Batch Operating Systems and is minimally present in Time-Sharing Operating Systems. The Short-Term Scheduler's primary function is to frequently select new processes for the processor, ensuring efficient CPU utilization.


Interprocess communication is the mechanism provided by the operating system that allows processes to communicate with each other. This communication could involve a process letting another process know that some event has occurred or the transferring of data from one process to another

different approaches to implement interprocess communication are given as follows −

  • Pipe
  • A pipe is a data channel that is unidirectional. Two pipes can be used to create a two-way data channel between two processes. This uses standard input and output methods. Pipes are used in all POSIX systems as well as Windows operating systems.
  • Socket
  • The socket is the endpoint for sending or receiving data in a network. This is true for data sent between processes on the same computer or data sent between different computers on the same network. Most of the operating systems use sockets for interprocess communication.
  • File
  • A file is a data record that may be stored on a disk or acquired on demand by a file server. Multiple processes can access a file as required. All operating systems use files for data storage.
  • Signal
  • Signals are useful in interprocess communication in a limited way. They are system messages that are sent from one process to another. Normally, signals are not used to transfer data but are used for remote commands between processes.
  • Shared Memory
  • Shared memory is the memory that can be simultaneously accessed by multiple processes. This is done so that the processes can communicate with each other. All POSIX systems, as well as Windows operating systems use shared memory.
  • Message Queue
  • Multiple processes can read and write data to the message queue without being connected to each other. Messages are stored in the queue until their recipient retrieves them. Message queues are quite useful for interprocess communication and are used by most operating systems.

Multithreading is a programming and execution model that allows multiple threads to exist within the context of a single process. These threads share the process's resources but can execute independently. This approach is used to perform multiple operations concurrently within the same program.

Advantages of Multithreading

  1. Increased Responsiveness:
  • In a multithreaded application, the execution of a heavy task can occur in the background while the main thread continues to respond to user inputs. This makes the application more responsive.
  1. Resource Sharing:
  • Threads within the same process share the same memory space and resources, which reduces the overhead associated with creating and managing separate processes.
  1. Improved Performance:
  • On multi-core or multi-processor systems, multithreading can lead to better utilization of CPU resources, allowing different threads to run on different cores simultaneously, thus speeding up execution.
  1. Simplified Coding of Concurrent Systems:
  • Multithreading simplifies the development of programs that perform multiple tasks at once, such as web servers handling multiple connections or user interfaces updating while performing background calculations.

What is Preemptive Scheduling?

Preemptive scheduling is used when a process switches from the running state to the ready state or from the waiting state to the ready state. The resources (mainly CPU cycles) are allocated to the process for a limited amount of time and then taken away, and the process is again placed back in the ready queue if that process still has CPU burst time remaining. That process stays in the ready queue till it gets its next chance to execute. 



What is Non-Preemptive Scheduling?

Non-preemptive Scheduling is used when a process terminates, or a process switches from running to the waiting state. In this scheduling, once the resources (CPU cycles) are allocated to a process, the process holds the CPU till it gets terminated or reaches a waiting state. In the case of non-preemptive scheduling does not interrupt a process running CPU in the middle of the execution. Instead, it waits till the process completes its CPU burst time, and then it can allocate the CPU to another process. 


Deadlock Prevention in operating systems involves strategies to ensure that at least one of the necessary conditions for deadlock does not hold. Here are the main techniques used to prevent deadlocks:

  1. Mutual Exclusion:
  • Ensure that resources that cannot be shared are not held by multiple processes simultaneously. For non-shareable resources like printers, techniques like spooling (queuing requests) can be used to avoid conflicts​ (Scaler)​.
  1. Hold and Wait:
  • Processes must either request all required resources at once before execution starts or release all held resources before requesting new ones. This prevents processes from holding some resources while waiting for others, thus avoiding deadlock scenarios​ (Scaler)​.
  1. No Preemption:
  • If a process holding resources is unable to obtain additional resources, it must release its current resources and request them again. Alternatively, higher-priority processes can preempt resources from lower-priority processes, which can then re-request the resources later​ (Scaler)​.
  1. Circular Wait:
  • Impose an ordering of resource types and require processes to request resources in a particular sequence, ensuring that circular waiting conditions cannot occur. For example, if resources are numbered, a process must request resources in increasing order of their numbers​ (Scaler)​​ (www.javatpoint.com)​.

The Banker’s Algorithm is a resource allocation and deadlock avoidance algorithm that tests for safety by simulating the allocation for the predetermined maximum possible amounts of all resources, then makes an “s-state” check to test for possible activities, before deciding whether allocation should be allowed to continue.

The Banker’s Algorithm is a smart way for computer systems to manage how programs use resources, like memory or CPU time. It helps prevent situations where programs get stuck and can’t finish their tasks, which is called deadlock. By keeping track of what resources each program needs and what’s available, the algorithm makes sure that programs only get what they need in a safe order. 


The Banker's Algorithm is a deadlock avoidance method used in operating systems to manage resource allocation. It works by ensuring that a system only allocates resources in a way that will leave it in a safe state. This means that the system can allocate resources to each process in some order and still avoid deadlock.

Key Concepts

  1. Available: A vector that represents the number of available instances of each resource type.
  2. Max: A matrix indicating the maximum demand of each process.
  3. Allocation: A matrix indicating the number of resources currently allocated to each process.
  4. Need: A matrix representing the remaining resource needs of each process, calculated as Need[i][j] = Max[i][j] - Allocation[i][j].

Steps of the Banker's Algorithm

  1. Resource Request Algorithm: When a process requests resources, the system checks if the request can be granted while keeping the system in a safe state:
  • Check if the request is less than or equal to the need.
  • Check if the request is less than or equal to the available resources.
  • Provisionally allocate the resources and update the matrices.
  1. Safety Algorithm: Determines if the system is in a safe state after the provisional allocation:
  • Initialize the Work vector with the available resources.
  • Find a process whose resource needs can be satisfied with the current Work vector and mark it as finished.
  • If all processes can be marked as finished, the system is in a safe state.


Swapping is the process of bringing a process into memory and then temporarily copying it to the disc after it has run for a while. The purpose of swapping in an operating system is to access data on a hard disc and move it to RAM so that application programs can use it. It’s important to remember that swapping is only used when data isn’t available in RAM. Although the swapping process degrades system performance, it allows larger and multiple processes to run concurrently. Because of this, swapping is also known as memory compaction. The CPU scheduler determines which processes are swapped in and which are swapped out. Consider a multiprogramming environment that employs a priority-based scheduling algorithm. When a high-priority process enters the input queue, a low-priority process is swapped out so the high-priority process can be loaded and executed. When this process terminates, the low priority process is swapped back into memory to continue its execution

Paging is a memory management scheme that eliminates the need for a contiguous allocation of physical memory. The process of retrieving processes in the form of pages from the secondary storage into the main memory is known as paging. The basic purpose of paging is to separate each procedure into pages. Additionally, frames will be used to split the main memory. This scheme permits the physical address space of a process to be non – contiguous.

In paging, the physical memory is divided into fixed-size blocks called page frames, which are the same size as the pages used by the process. The process’s logical address space is also divided into fixed-size blocks called pages, which are the same size as the page frames. When a process requests memory, the operating system allocates one or more page frames to the process and maps the process’s logical pages to the physical page frames.

The mapping between logical pages and physical page frames is maintained by the page table, which is used by the memory management unit to translate logical addresses into physical addresses. The page table maps each logical page number to a physical page frame number.


A process is divided into Segments. The chunks that a program is divided into which are not necessarily all of the exact sizes are called segments. Segmentation gives the user’s view of the process which paging does not provide. Here the user’s view is mapped to physical memory.

Types of Segmentation in Operating Systems

  • Virtual Memory Segmentation: Each process is divided into a number of segments, but the segmentation is not done all at once. This segmentation may or may not take place at the run time of the program.
  • Simple Segmentation: Each process is divided into a number of segments, all of which are loaded into memory at run time, though not necessarily contiguously.