QUESTION 1
IN BEST FIT WE CAN LOOP THROUGH ALL POSSIBLE HOLES AND FIND THE BEST FIT HOLE THAT CAN BE UTILIZED TO GRANT THE ACCESS TO THE REQUEST TO THE USER. WE SUBTRACT THE REQUEST FROM ALL THE POSSIBLE HOLE AND THEN GRANT THE REQUEST TO THE LOWEST POSSIBLE NON NEGATIVE HOLE.
REQUEST 1 - HOLE 5
REQUEST 2 - HOLE 3
REQUEST 3 - HOLE 8
REQUEST 4 - HOLE 7
QUESTION 2-
THE METHOD TO PREVENT A DEADLOCK BEFORE IT ACTUALLY HAPPENS IS CALLED AS DEADLOCK PREVENTION AND DEADLOCK AVOIDANCE.
DEADLOCK PREVENTION IS THE MECHANISM TO ENSURE THAT AT LEAST ONE OF THE NECESSARY CONDITION FOR DEADLOCK NEVER OCCUR. TO PREVENT A DEADLOCK SITUATION , IT IS NOT NECESSARY TO KNOW ALL EXISTING RESOURCES , AVAILABILITY AND REQUESTS. NON - BLOCKING SYNCRONIZATION AGORITHMS AND SEARILIZING TOKENS ARE SOME OF DEADLOCK PREVENTION ALGORITHMS. IN MOST OF THE SYSTEM THE DEADLOCK PREVENTION ALGORITHMS CANT BE IMPLEMENTED.
ACCORDING TO DEADLOCK AVOIDANCE WE APPLY A MECHANISMS THAT INVOLVES SAFE STATE . A SYSTEM IS A SAFE WHEN IT IS POSSIBLE TO ALLOCATE RESOURCES TO ALL PROCESSES IN SOME ORDER WITHOUT CAUSING DEADLOCK , DEADLOCK AVOIDANCE IS A MECHANISM TO ENSURE THAT THE SYSTEM DOES NOT ENTER AN UNSAFE STATE. IN OTHER WORDS , IT ENSURES THAT THE SYSTEM DOES NOT HAVE A DEADLOCK. TO AVOID A SYSTEM FROM REACHING AN UNSAFE STATE , THE SYSTEM SHOULD KNOW ABOUT THE NUMBER OF EXISTING RESOURCES , AVAILABILITY AND REQUESTS.
ASK ANY DOUBTS IN THE COMMENTS.
USE THIS ILLUSTRATION BELOW FOR DYNAMIC PARTITIONING QUESTIONS Hole 4 Hole 1 20K Hole 2 12K...
(15 points) Consider a swapping system in which memory consists of the following hole sizes in memory order: 16K, 14K, 4K, 20K, 18K, 7K, 9K, 12K, and 15K. Which hole is taken for successive segment requests of (a) 12K (b) 10K (c) 9K for first fit? Now repeat the question for best fit, worst fit, and next fit
(15 points) Consider a swapping system in which memory consists of the following hole sizes in memory order: 16K, 14K, 4K, 20K,...
Assume a swapping system in which memory consists of the following hole sizes in memory and in order of 12K, 16K, 8K, 10K, 22K, 8K, 11K, 14K, and 13K.(5marks)Which memory hole is taken for successive segment requests of(a) 7K (b) 30K (c) 20K(d) 6k(e) 2kfor first fit, best fit, worst fit, and next fit. Assume a swapping system in which memory consists of the following hole sizes in memory and in order of 12K, 16K, 8K, 10K, 22K, 8K, 11K, 14K,...