answer is 19 units.
@Swapnil Naik because all the job is initial available
@Tuhin Dutta it is the static allocation so the J8 should go in the 2K slot even though the 4K is empty before 2K slot,
@Kushagra गुप्ता Here should we assume like it is a multicore CPU?
Partitons are $4k , 8k, 20k, 2k$, now due to best fit algo,
and next job size of $10 k$ $(5)$ wait for the partition of $20k$ and after completion of no. $2$ job, job no. $5$ will be executed for $1$ unit ($10$ to $11$). Now, $20 k$ is also waiting for partition of $20k$, because it is best fit for it. So after completion of job $5$, it will be fit . So, it will execute for $8$ unit which is $11$ to $19$. So, at $19$ unit $20k$ job will be completed .
Answer should be $19$ units.
There are two 6k requests in the question and you have considered only 1,
the first 6k request will be satisfied by the 20k partition executing 14k request, and from the next 6k request your answer will apply,
Although answer will be same, at 19s.
No, don't consider CPU scheduling as it is not mentioned.
Whenever the context is partitioning or allocation using best fit etc Consider the execution time as the time for which a process will occupy a partition. These kind of questions should be dealt in this way.
I have a doubt.
After we put '14K' process into '20K' partition, there'll be '6K' left. The next '6K' can be put into it instead of '8K' partition. This delays the execution of '20K' process by one unit.
So, shouldn't the answer be 20?
Please correct me if I'm missing anything here.
In question it's not specifically mentioned that we gotta consider STATIC-PARTITIONING so why we're allowing only one-process in a partition at a time?
But a 14k process in 20k partition isn't occupying the partition completely and a process of 6k can be fitted in there. How their address-spaces are essentially overlapping?
If the question were about fixed/static-partitioning then you would have been surely correct.
Ans: 19 time unit
First thing we can do is distributes the jobs among partitions as given below:
Now question is asked for 20K job so clearly it depends on 14K and 10K jobs
So it will complete after: 14K Execution time (10) + 10K Execution time (1) + 20K Execution time (8)
The explanations need not to be that long and complex as people have been doing here. But I always love and appreciate the discussion of GO.
First of all do note that partitions in memory are already given. So the partition is of Fixed type. Partitions are fixed and no new partition is going to be generated.
Hence we do not need to worry about the holes which could be created and about merging them or anything as done in Dynamic partitioning.
According to best fit algorithm 20 k job will get the third partition of size 20k. But before 20k job we have 14k job and 10k job which also will get 20k partition according to best fit algorithm and as they are earlier in the list so they get the partition first(generaly this is what we do regarding proesses if nothing is given). 14k and 10k job will complete in 11 unit time then 20k job takes 8 unit time so 20 k job will finish at 19 sec if procedure starts from 0 sec.