in Operating System
458 views
0 votes
0 votes
Consider a System Using Variable Partition with no Compaction

Free holes : 4K; 8K; 20K; 2K

Program size: 2K; 14K; 3K; 6K; 10K; 20K; 2K

Time for Execution:  4; 10; 2; 1; 4; 1; 8

Using Best Fit Allocation Policy and FCFS CPU Scheduling

Technique, Find the Time of Loading & Time of Completion of each program. The Burst Times are in Seconds.
in Operating System
by
458 views

1 Answer

0 votes
0 votes

Let's use the Best Fit Allocation policy and FCFS CPU scheduling technique to load and execute the programs. I'll go step by step:

  1. Program size: 2K

    • Best Fit: Allocate in the 2K hole.
    • Time of Loading: 0 seconds (instantaneous)
    • Time of Completion: 4 seconds (execution time)
  2. Program size: 14K

    • Best Fit: Allocate in the 20K hole (closest fit).
    • Time of Loading: 4 seconds (after the completion of the first program)
    • Time of Completion: 14 + 4 = 18 seconds
  3. Program size: 3K

    • Best Fit: Allocate in the 4K hole.
    • Time of Loading: 18 seconds (after the completion of the second program)
    • Time of Completion: 18 + 2 = 20 seconds
  4. Program size: 6K

    • Best Fit: Allocate in the 8K hole.
    • Time of Loading: 20 seconds (after the completion of the third program)
    • Time of Completion: 20 + 1 = 21 seconds
  5. Program size: 10K

    • Best Fit: Allocate in the 20K hole (closest fit).
    • Time of Loading: 21 seconds (after the completion of the fourth program)
    • Time of Completion: 21 + 4 = 25 seconds
  6. Program size: 20K

    • Best Fit: Allocate in the 20K hole (exact fit).
    • Time of Loading: 25 seconds (after the completion of the fifth program)
    • Time of Completion: 25 + 1 = 26 seconds
  7. Program size: 2K

    • Best Fit: Allocate in the 4K hole.
    • Time of Loading: 26 seconds (after the completion of the sixth program)
    • Time of Completion: 26 + 8 = 34 seconds

So, the time of loading and time of completion for each program are as follows:

  • Program 1: Load at 0 seconds, Complete at 4 seconds.
  • Program 2: Load at 4 seconds, Complete at 18 seconds.
  • Program 3: Load at 18 seconds, Complete at 20 seconds.
  • Program 4: Load at 20 seconds, Complete at 21 seconds.
  • Program 5: Load at 21 seconds, Complete at 25 seconds.
  • Program 6: Load at 25 seconds, Complete at 26 seconds.
  • Program 7: Load at 26 seconds, Complete at 34 seconds.

 

 

 

 

 

 

Related questions