Question

In: Computer Science

List two algorithms commonly used to identify a frame for replacement

List two algorithms commonly used to identify a frame for replacement

Solutions

Expert Solution

1.

First In First Out (FIFO) :

Here, whenever there is a need of replacement, the frame that came into the memory the earliest, is removed/replaced.

For example, let's say the memory can hold a maximum of 3 frames, in slots s1, s2, s3.

Following is a sample sequencing :

  • Frame 5 is accessed
    • s1 => frame 5
  • Frame 1 is accessed
    • s1 => frame 5
    • s2 => frame 1
  • Frame 5 is accessed
    • s1 => frame 5
    • s2 => frame 1
  • Frame 14 is accessed
    • s1 => frame 5
    • s2 => frame 1
    • s3 => frame 14
  • Frame 18 is accessed
    • s1 => frame 18
    • s2 => frame 1
    • s3 => frame 14

As seen, frame 5 (which came in first amongst all of frames 5, 1, 14) was replaced, and the incoming frame 18 replaced in its place.

2.

Least Recently Used (LRU) :

Here, whenever there is a need of replacement, the frame that has been used least recently, is removed.

We take the same example as above.

Also, we maintain a linked list, where the element on the leftmost side is the oldest (least recently used), and the element on the rightmost is newest (most recently used).

  • Frame 5 is accessed
    • s1 => frame 5
    • List : 5
  • Frame 1 is accessed
    • s1 => frame 5
    • s2 => frame 1
    • List : 5 -> 1
  • Frame 5 is accessed
    • s1 => frame 5
    • s2 => frame 1
    • List : 1 -> 5
  • Frame 14 is accessed
    • s1 => frame 5
    • s2 => frame 1
    • s3 => frame 14
    • List : 1 -> 5 -> 14
  • Frame 18 is accessed
    • s1 => frame 5
    • s2 => frame 18
    • s3 => frame 14
    • List : 5 -> 14 -> 18

As seen, frame 1 (which was the least recently used frame) was replaced, and the incoming frame 18 replaced in its place.


Related Solutions

List and explain at least two indicators that are commonly used to measure health.
List and explain at least two indicators that are commonly used to measure health.
List and define the alternative page fetch policies.   (0.5 point each) What are three replacement algorithms?...
List and define the alternative page fetch policies.   (0.5 point each) What are three replacement algorithms? (.333 points each) What is the purpose of the TLB?   (0.5 points)
.Identify three research methods that are commonly used in educational psychology.
.Identify three research methods that are commonly used in educational psychology.
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data...
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data on the force (measured in Newtons, N) required to break a cement bond was determined under two different temperature conditions and in two different mediums appear in the following table. Temperature Medium Data on Breaking Force 22 degrees Dry 100.6, 142.7, 194.8, 118.4, 176.1, 213.1 37 degrees Dry 302.3, 339.3, 288.8, 306.8, 305.2, 327.5 22 degrees Wet 385.3, 368.2, 322.6, 307.4, 357.9, 321.4 37...
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data...
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data on the force (measured in Newtons, N) required to break a cement bond was determined under two different temperature conditions and in two different mediums appear in the following table. Temperature Medium Data on Breaking Force 22 degrees Dry 100.6, 142.7, 194.8, 118.4, 176.1, 213.1 37 degrees Dry 302.3, 339.3, 288.8, 306.8, 305.2, 327.5 22 degrees Wet 385.3, 368.2, 322.6, 307.4, 357.9, 321.4 37...
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data...
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data on the force (measured in Newtons, N) required to break a cement bond was determined under two different temperature conditions and in two different mediums appear in the following table. Temperature Medium Data on Breaking Force 22 degrees Dry 100.7, 142.8, 194.8, 118.4, 176.1, 213.1 37 degrees Dry 302.1, 338.1, 288.8, 306.8, 305.2, 327.5 22 degrees Wet 386.3, 367.3, 322.6, 307.4, 357.9, 321.4 37...
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data...
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data on the force (measured in Newtons, N) required to break a cement bond was determined under two different temperature conditions and in two different mediums appear in the following table. Temperature Medium Data on Breaking Force 22 degrees Dry 100.7, 142.7, 194.8, 118.4, 176.1, 213.1 37 degrees Dry 302.2, 338.3, 288.8, 306.8, 305.2, 327.5 22 degrees Wet 385.4, 367.2, 322.6, 307.4, 357.9, 321.4 37...
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data...
Acrylic bone cement is commonly used in total joint replacement to secure the artificial joint. Data on the force (measured in Newtons, N) required to break a cement bond was determined under two different temperature conditions and in two different mediums appear in the following table. Temperature Medium Data on Breaking Force 22 degrees Dry 100.7, 142.7, 194.8, 118.4, 176.1, 213.1 37 degrees Dry 302.2, 338.3, 288.8, 306.8, 305.2, 327.5 22 degrees Wet 385.4, 367.2, 322.6, 307.4, 357.9, 321.4 37...
List and describe the four pricing models commonly used in the software industry.
List and describe the four pricing models commonly used in the software industry.
What are the four methods commonly used to identify the fixed and variable elements of a...
What are the four methods commonly used to identify the fixed and variable elements of a mixed cost? and Identify the strength and weakness of each method identified.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT