Open In App
Related Articles

Resource Allocation Techniques for Processes

Improve Article
Improve
Save Article
Save
Like Article
Like

The Operating System allocates resources when a program need them. When the program terminates, the resources are de-allocated, and allocated to other programs that need them. Now the question is, what strategy does the operating system use to allocate these resources to user programs? 

There are two Resource allocation techniques:

     1. Resource partitioning approach – In this approach, the operating system decides beforehand, that what resources should be allocated to which user program. It divides the resources in the system to many resource partitions, where each partition may include various resources – for example, 1 MB memory, disk blocks, and a printer. Then, it allocates one resource partition to each user program before the program’s initiation. A resource table records the resource partition and its current allocation status (Allocated or Free). 

          Advantages:

  • Easy to Implement
  • Less Overhead

          Disadvantages:

  • Lacks flexibility – if a resource partition contains more resources than what a particular process requires, the additional resources are wasted.
  • If a program needs more resources than a single resource partition, it cannot execute (Though free resources are present in other partitions).

           An Example Resource Table may look like this:-

 

           The above Resource Table is of the time of Booting. Resource Table is the core data structure that is used in the resource allocation techniques. Resource Table contains resource partitions as entries rather than single resources.

     2. Pool based approach – In this approach, there is a common pool of resources. The operating System checks the allocation status in the resource table whenever a program makes a request for a resource. If the resource is free, it allocates the resource to the program. 

          Advantages:

  • Allocated resources are not wasted.
  • Any resource requirement can be fulfilled if the resource is free (unlike Partitioning approach)

          Disadvantages:

  • Overhead of allocating and de-allocating the resources on every request and release.
Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.

Last Updated : 14 May, 2023
Like Article
Save Article
Previous
Next
Similar Reads