Question 1.
A. Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs simultaneously. Multiprocessing makes it possible for several programs to be active at the same time while still running through a single processor. The key factor is that multiprogramming maximizes the CPU to run programs more efficiently.
B. Internal fragmentation is the space that is wasted inside of allocated memory blocks due to restrictions on the allowed sizes of allocated blocks, sometimes it is never even intended to be used. This is often accepted in return for increased efficiency.
C. External fragmentation is when free storage becomes divided into small sections over time. This occurs when an application allocates and deallocates regions of storage of various sizes, and the allocation algorithm responds by leaving the allocated and deallocated sections scattered. External fragmentation can also occur in file systems as files of various sizes are created, altered, and deleted. This is worsened if the file has been divided into smaller files and deleted, leaving miniscule areas of unused space.
D. Memory compaction is a method used to relocate information blocks in main memory in order to maximize the available free space in the memory.
E. Relocation can sometimes occur automatically when a program is being loaded. The frequency of memory relocation often depends on the operating systems designer who, based on the job mix and other factors, tries to optimize both processing time and memory use while keeping overhead as low as possible.
Question 2:
Describe the major disadvantages for each of the four memory allocation schemes presented in this chapter.
1. Single-user Systems: One of the first problems with this type of memory allocation scheme is that it doesn’t support multiprogramming or networking; it can only handle one job at a time. The other major disadvantage was when the first single-user configurations were made available commercially in the late 1940’s and early 1950’s they were not cost effective for business use. Averaging nearly $200,000 per piece of equipment for only one operator was not proficient.
2. Fixed Partitions: The size of a partition could only be designated when the machine was powered on, so in order to reconfigure a partition size, the machine had to be shut down, reconfigured, and powered back on. Fixed partitions often resulted in wasted memory. If the partition size was too small, larger jobs were rejected- which meant a longer turnaround time, on the other hand, if a partition size were too big, then memory sat idle and was wasted. Wasted space and partial usage of fixed partitions resulted in the phenomenon of internal fragmentation.
3. Dynamic Partitions: This memory scheme operates on the first come, first serve basis; meaning that as newer jobs enter the system that are not the same size as those that just vacated memory, they are fit into available spaces on a priority basis. When the subsequent allocation of memory creates fragments of free memory between blocks of allocated memory, external fragmentation arises.
4. Re-locatable Dynamic Partitions: This is a memory allocation scheme in which the system relocates programs in memory to gather together all of the empty blocks and compact them to make one block of memory that is large enough to accommodate some or all of the jobs waiting for memory. Problems arise when deciding on the best possible time of the compaction.
Question 3:
Describe the major advantages for each of the memory allocation schemes presented in the chapter.
1. Single-user Systems: The code to perform the functions is straightforward, and the logic is simple. It required only two hardware items, a register and an accumulator.
2. Fixed Partitions: This partition scheme was more flexible than the single-user scheme because it allowed several programs to be in memory at the same time. It worked best if all the jobs on the system were of the same size or if the sizes were known ahead of time.
3. Dynamic Partitions: Available memory was kept in contiguous blocks, and jobs were only given as much memory as they requested when being loaded into memory.
4. Re-locatable Dynamic Partitions: Memory manager relocates programs to gather together all of the empty blocks and compact them to make one block of memory large enough to accommodate some or all of the jobs waiting to get in.
Question 4:
A. Job 1 would enter block 2, Job 2 would enter block 1, and Job 3 would enter block 3.
B. Job 1 would wait, Job 2 would enter block 1, job 3 would then enter block 2, and job 1 would enter block 2 once Job 1 completed.
No comments:
Post a Comment