Skip to content

The code doesn't show exact output #5

@ghost

Description

when the process once got allocated,it again searches to another block of size greater.
The modification should be done as given below:
The flag should be used which checks for the process which is already allocated into the block.
int flag1[n];
for(i=0;i<n;i++)
{
flag1[i]=0;
}
for(i=0;i<n;i++){
for(j=0;j<nb;j++) {
if(blockSize[j]>=jobSize[i] && blockSize[j]>0 && flag1[i]==0) {
alloc[i]=j;
flag1[i]=1;

            blockSize[j]=blockSize[j]-jobSize[i];
            
        }
    }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions