Describe two segment-replacement algorithms, Operating System

Assignment Help:

Q. Segmentation is alike to paging but uses variable-sized "pages". Describe two segment-replacement algorithms based on FIFO and LRU page replacement schemes. Remember that since segments aren't the same size the segment that is chosen to be replaced mayn't be big enough to leave enough consecutive locations for the needed segment. Consider tactics for systems where segments cannot be relocated and those for systems where they can.

Answer:

a. FIFO. Find the first segment large sufficient to accommodate the incoming segment. If relocation isn't possible and no one segment is large enough select a combination of segments whose memories are contiguous which are closest to the first of the list and which are able to accommodate the new segment. If relocation is probable rearrange the memory so that the first N segments large sufficient for the incoming segment are contiguous in memory. Add any leftover space to the free-space list in both cases.

b. LRU. Select the segment that hasn't been used for the longest period of time and that is large enough adding any leftover space to the free space list. If no one segment is large sufficient select a combination of the oldest segments that are contiguous in memory (if relocation isn't available) as well as that are large enough.

If relocation is obtainable rearrange the oldest N segments to be contiguous in memory as well as replace those with the new segment.


Related Discussions:- Describe two segment-replacement algorithms

What is super block, What is super block A partition control block have...

What is super block A partition control block have partitions details, such as the number of blocks in the partition, size of the blocks, free-blocks and free-block pointers an

Virtual memory and paging, A- Consider a computer system that provides a vi...

A- Consider a computer system that provides a virtual memory space that consists of 8  pages. The physical memory contains 4 pages where the page size is 4Kbytes. Assume that at sp

Backup and recovery, what is it all about? why do we need? what are the typ...

what is it all about? why do we need? what are the types of backup? how is it done in unix?

Allocation techniques, Since most of the programs require a lot of memory a...

Since most of the programs require a lot of memory allocation/deallocation, we expect the memory management to be fast, to have low fragmentation, make good use of locality, and be

Unix, UNIX Shell and History feature. 1.Creating a child process. 2.Creatin...

UNIX Shell and History feature. 1.Creating a child process. 2.Creating a history feature. With the notes under code. Its exactly "programming project 1 - Unix Shell and History Fea

How can a user program disturb the normal operation, How can a user program...

How can a user program disturb the normal operation of the system? a) Issuing illegal I/O operation. b) By accessing memory locations within the OS itself. c) Refusing to

Define the dossleep(ms) function used in the os/2, Define the DosSleep(ms) ...

Define the DosSleep(ms) Function used in the os/2 DosSleep()  suspends the currently executing  thread for some time interval specified in the  ms parameter. If a value of 0 is

Define a set of methods that allow executing a program, A set of methods th...

A set of methods that allow executing a program which is not completely in memory   is called A set of methods that allow executing a program which is not completely in memory

Define dynamic linking, Define dynamic linking. Dynamic linking is same...

Define dynamic linking. Dynamic linking is same to dynamic loading, rather that loading being postponed unless execution time, linking is postponed. This feature is usually use

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd