Operating system practical page memory management

Practical page memory management

Curriculum design objectives (realized under Qt)
1. Code Description: page table, page box table, task structure
2. Code implementation: page request, page replacement
3. Simulate the page access process of the task (visit virtual memory)
4. Task scheduling (extension) in analog operating system



Key points of implementation
1. The page box table is globally unique, which is used to record the usage of memory pages
2. The page table is task private, which is used to record the mapping relationship between virtual page and memory page
3. Each task needs to be represented by a structure


Implementation key points
1. Page box assignment: int GetFrameItem()
2. Page request operation: int RequestPage(int pid,int page)
3. Page exchange operation: int SwapPage()
Implementation key points
How to simulate different tasks when implementing paged memory management? Page access sequence can be generated according to different virtual page access sequence of different tasks

The flow chart of the implementation is as follows

code implementation








#include <QtCore/QCoreApplication>
#include <QList>
#include <iostream>
#include <ctime>

using namespace std;
//Globally defined page box table page table
#define PAGE_NUM  (0xFF + 1)
#define FRAME_NUM (0x04)
#define FP_NONE   (-1)

struct FrameItem//Page box table
{
    int pid;    // the task which use the frame
    int pnum;   // the page which the frame hold

    FrameItem()
    {
        pid = FP_NONE;
        pnum = FP_NONE;
    }
};

class PageTable//Page table
{
    int m_pt[PAGE_NUM];
public:
    PageTable()
    {
        for(int i=0; i<PAGE_NUM; i++)
        {
            m_pt[i] = FP_NONE;
        }
    }

    int& operator[] (int i)
    {
        if( (0 <= i) && (i < length()) )
        {
            return m_pt[i];
        }
        else
        {
            QCoreApplication::exit(-1);
        }
    }

    int length()
    {
        return PAGE_NUM;
    }
};

class PCB
{
    int m_pid;               // task id
    PageTable m_pageTable;   // page table for the task
    int* m_pageSerial;       // simulate the page serial access
    int m_pageSerialCount;   // page access count
    int m_next;              // the next page index to access
public:
    PCB(int pid)
    {
        m_pid = pid;
        m_pageSerialCount = qrand() % 5 + 5;
        m_pageSerial = new int[m_pageSerialCount];

        for(int i=0; i<m_pageSerialCount; i++)
        {
            m_pageSerial[i] = qrand() % 8;
        }

        m_next = 0;
    }

    int getPID()
    {
        return m_pid;
    }

    PageTable& getPageTable()
    {
        return m_pageTable;
    }

    int getNextPage()
    {
        int ret = m_next++;

        if( ret < m_pageSerialCount )
        {
            ret = m_pageSerial[ret];
        }
        else
        {
            ret = FP_NONE;
        }

        return ret;
    }

    bool running()
    {
        return (m_next < m_pageSerialCount);
    }

    void printPageSerial()
    {
        QString s = "";

        for(int i=0; i<m_pageSerialCount; i++)
        {
            s += QString::number(m_pageSerial[i]) + " ";
        }

        cout << ("Task" + QString::number(m_pid) + " : " + s).toStdString() << endl;
    }

    ~PCB()
    {
        delete[] m_pageSerial;
    }
};

FrameItem FrameTable[FRAME_NUM];
QList<PCB*> TaskTable;

int GetFrameItem();
void AccessPage(PCB& pcb);
int RequestPage(int pid, int page);
int SwapPage();
//The realization of printing function
void PrintLog(QString log);
void PrintPageMap(int pid, int page, int frame);
void PrintFatalError(QString s, int pid, int page);

int GetFrameItem()
{
    int ret = FP_NONE;

    for(int i=0; i<FRAME_NUM; i++)
    {
        if( FrameTable[i].pid == FP_NONE )
        {
            ret = i;
            break;
        }
    }

    return ret;
}

void AccessPage(PCB& pcb)
{
    int pid = pcb.getPID();
    PageTable& pageTable = pcb.getPageTable();
    int page = pcb.getNextPage();

    if( page != FP_NONE )
    {
        PrintLog("Access Task" + QString::number(pid) + " for Page" + QString::number(page));

        if( pageTable[page] != FP_NONE )
        {
            PrintLog("Find target page in page table.");
            PrintPageMap(pid, page, pageTable[page]);
        }
        else
        {
            PrintLog("Target page is NOT found, need to request page ...");

            pageTable[page] = RequestPage(pid, page);

            if( pageTable[page] != FP_NONE )
            {
                PrintPageMap(pid, page, pageTable[page]);
            }
            else
            {
                PrintFatalError("Can NOT request page from disk...", pid, page);
            }
        }
    }
    else
    {
        PrintLog("Task" + QString::number(pid) + " is finished!");
    }
}

int RequestPage(int pid, int page)
{
    int frame = GetFrameItem();

    if( frame != FP_NONE )
    {
        PrintLog("Get a frame to hold page content: Frame" + QString::number(frame));
    }
    else
    {
        PrintLog("No free frame to allocate, need to swap page out.");

        frame = SwapPage();

        if( frame != FP_NONE )
        {
            PrintLog("Succeed to swap lazy page out.");
        }
        else
        {
            PrintFatalError("Failed to swap page out.", pid, FP_NONE);
        }
    }

    PrintLog("Load content from disk to Frame" + QString::number(frame));

    FrameTable[frame].pid = pid;
    FrameTable[frame].pnum = page;

    return frame;
}
//Implementation of random generation
int Random()
{
    // just random select
    int obj = qrand() % FRAME_NUM;

    PrintLog("Random select a frame to swap page content out: Frame" + QString::number(obj));
    PrintLog("Write the selected page content back to disk.");

    FrameTable[obj].pid = FP_NONE;
    FrameTable[obj].pnum = FP_NONE;

    for(int i=0, f=0; (i<TaskTable.count()) && !f; i++)
    {
        PageTable& pt = TaskTable[i]->getPageTable();

        for(int j=0; j<pt.length(); j++)
        {
            if( pt[j] == obj )
            {
                pt[j] = FP_NONE;
                f = 1;
                break;
            }
        }
    }

    return obj;
}

int SwapPage()
{
    return Random();
}

void PrintLog(QString log)
{
    cout << log.toStdString() << endl;
}

void PrintPageMap(int pid, int page, int frame)
{
    QString s = "Task" + QString::number(pid) + " : ";

    s += "Page" + QString::number(page) + " ==> Frame" + QString::number(frame);

    cout << s.toStdString() << endl;
}

void PrintFatalError(QString s, int pid, int page)
{
    s += " Task" + QString::number(pid) + ": Page" + QString::number(page);

    cout << s.toStdString() << endl;

    QCoreApplication::exit(-2);
}
//realization
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    int index = 0;

    qsrand(time(NULL));

    TaskTable.append(new PCB(1));

    PrintLog("Task Page Serial:");

    for(int i=0; i<TaskTable.count(); i++)
    {
        TaskTable[i]->printPageSerial();
    }

    PrintLog("==== Running ====");

    while( true )
    {
        if( TaskTable[index]->running() )
        {
            AccessPage(*TaskTable[index]);
        }

        index = (index + 1) % TaskTable.count();

        cin.get();
    }

    return a.exec();
}

Achieve results

It can be seen from the program running results that five pages are randomly generated, four page boxes are defined when the program is defined, and the first four pages 25 6 can be seen when the program is running 1 has a one-to-one mapping relationship with the four page boxes respectively. When running to page 7, it is found that the page box is used up and needs to be reapplied. At this time, the pages in page box 2 are randomly exchanged and page 7 is inserted

Real page memory management

Course design objectives
1. Handle the task at the end of operation
2. Algorithm of FIFO page exchange
3. Implement LRU page exchange algorithm
Goal 1
1. Remove the task structure from the task table
2. Page box used by recycle task
3. Free the memory occupied by the task structure








Goal 2: implement FIFO page exchange algorithm


Principle: use queue (Qt) to record the usage time of page box. Page box is sorted in queue, and the page box that first enters the queue is removed during exchange
Process: apply for the queue. The page request is successful. Add the corresponding page box number to the end of the queue. When making a page request, there is no free page box, so page exchange is needed, and the queue page box at the head is removed from the queue
code implementation


#include <QtCore/QCoreApplication>
#include <QList>
#include <QQueue>
#include <iostream>
#include <ctime>

using namespace std;

#define PAGE_NUM  (0xFF + 1)
#define FRAME_NUM (0x04)
#define FP_NONE   (-1)

struct FrameItem
{
    int pid;    // the task which use the frame
    int pnum;   // the page which the frame hold
    int ticks;  // the ticks to mark the usage frequency

    FrameItem()
    {
        pid = FP_NONE;
        pnum = FP_NONE;
        ticks = 0xFF;
    }
};

class PageTable
{
    int m_pt[PAGE_NUM];
public:
    PageTable()
    {
        for(int i=0; i<PAGE_NUM; i++)
        {
            m_pt[i] = FP_NONE;
        }
    }

    int& operator[] (int i)
    {
        if( (0 <= i) && (i < length()) )
        {
            return m_pt[i];
        }
        else
        {
            QCoreApplication::exit(-1);
            return m_pt[0]; // for avoid warning
        }
    }

    int length()
    {
        return PAGE_NUM;
    }
};

class PCB
{
    int m_pid;               // task id
    PageTable m_pageTable;   // page table for the task
    int* m_pageSerial;       // simulate the page serial access
    int m_pageSerialCount;   // page access count
    int m_next;              // the next page index to access
public:
    PCB(int pid)
    {
        m_pid = pid;
        m_pageSerialCount = qrand() % 5 + 5;
        m_pageSerial = new int[m_pageSerialCount];

        for(int i=0; i<m_pageSerialCount; i++)
        {
            m_pageSerial[i] = qrand() % 8;
        }

        m_next = 0;
    }

    int getPID()
    {
        return m_pid;
    }

    PageTable& getPageTable()
    {
        return m_pageTable;
    }

    int getNextPage()
    {
        int ret = m_next++;

        if( ret < m_pageSerialCount )
        {
            ret = m_pageSerial[ret];
        }
        else
        {
            ret = FP_NONE;
        }

        return ret;
    }

    bool running()
    {
        return (m_next < m_pageSerialCount);
    }

    void printPageSerial()
    {
        QString s = "";

        for(int i=0; i<m_pageSerialCount; i++)
        {
            s += QString::number(m_pageSerial[i]) + " ";
        }

        cout << ("Task" + QString::number(m_pid) + " : " + s).toStdString() << endl;
    }

    ~PCB()
    {
        delete[] m_pageSerial;
    }
};

FrameItem FrameTable[FRAME_NUM];
QList<PCB*> TaskTable;
QQueue<int> MoveOut;

int GetFrameItem();
void AccessPage(PCB& pcb);
int RequestPage(int pid, int page);
int SwapPage();
void ClearFrameItem(PCB& pcb);
void ClearFrameItem(int frame);
int Random();
int FIFO();
int LRU();
void PrintLog(QString log);
void PrintPageMap(int pid, int page, int frame);
void PrintFatalError(QString s, int pid, int page);

int GetFrameItem()
{
    int ret = FP_NONE;

    for(int i=0; i<FRAME_NUM; i++)
    {
        if( FrameTable[i].pid == FP_NONE )
        {
            ret = i;
            break;
        }
    }

    return ret;
}

void AccessPage(PCB& pcb)
{
    int pid = pcb.getPID();
    PageTable& pageTable = pcb.getPageTable();
    int page = pcb.getNextPage();

    if( page != FP_NONE )
    {
        PrintLog("Access Task" + QString::number(pid) + " for Page" + QString::number(page));

        if( pageTable[page] != FP_NONE )
        {
            PrintLog("Find target page in page table.");
            PrintPageMap(pid, page, pageTable[page]);
        }
        else
        {
            PrintLog("Target page is NOT found, need to request page ...");

            pageTable[page] = RequestPage(pid, page);

            if( pageTable[page] != FP_NONE )
            {
                PrintPageMap(pid, page, pageTable[page]);
            }
            else
            {
                PrintFatalError("Can NOT request page from disk...", pid, page);
            }
        }

        FrameTable[pageTable[page]].ticks++;
    }
    else
    {
        PrintLog("Task" + QString::number(pid) + " is finished!");
    }
}

int RequestPage(int pid, int page)
{
    int frame = GetFrameItem();

    if( frame != FP_NONE )
    {
        PrintLog("Get a frame to hold page content: Frame" + QString::number(frame));
    }
    else
    {
        PrintLog("No free frame to allocate, need to swap page out.");

        frame = SwapPage();

        if( frame != FP_NONE )
        {
            PrintLog("Succeed to swap lazy page out.");
        }
        else
        {
            PrintFatalError("Failed to swap page out.", pid, FP_NONE);
        }
    }

    PrintLog("Load content from disk to Frame" + QString::number(frame));

    FrameTable[frame].pid = pid;
    FrameTable[frame].pnum = page;
    FrameTable[frame].ticks = 0xFF;

    MoveOut.enqueue(frame);//Insert page box number

    return frame;
}

void ClearFrameItem(int frame)
{
    FrameTable[frame].pid = FP_NONE;
    FrameTable[frame].pnum = FP_NONE;

    for(int i=0, f=0; (i<TaskTable.count()) && !f; i++)
    {
        PageTable& pt = TaskTable[i]->getPageTable();

        for(int j=0; j<pt.length(); j++)
        {
            if( pt[j] == frame )
            {
                pt[j] = FP_NONE;
                f = 1;
                break;
            }
        }
    }
}

int Random()
{
    // just random select
    int obj = qrand() % FRAME_NUM;

    PrintLog("Random select a frame to swap page content out: Frame" + QString::number(obj));
    PrintLog("Write the selected page content back to disk.");

    ClearFrameItem(obj);

    return obj;
}

int FIFO()//FIFO implementation
{
    // select the first page in memory to move out
    int obj = MoveOut.dequeue();//Out of queue operation

    PrintLog("Select a frame to swap page content out: Frame" + QString::number(obj));
    PrintLog("Write the selected page content back to disk.");

    ClearFrameItem(obj);

    return obj;
}

int LRU()
{
    int obj = 0;
    int ticks = FrameTable[obj].ticks;
    QString s = "";

    for(int i=0; i<FRAME_NUM; i++)
    {
        s += "Frame" + QString::number(i) + " : " + QString::number(FrameTable[i].ticks) + "    ";

        if( ticks > FrameTable[i].ticks )
        {
            ticks = FrameTable[i].ticks;
            obj = i;
        }
    }

    PrintLog(s);
    PrintLog("Select the LRU frame page to swap content out: Frame" + QString::number(obj));
    PrintLog("Write the selected page content back to disk.");

    return obj;
}

int SwapPage()
{
    return FIFO();
}

void ClearFrameItem(PCB& pcb)
{
    for(int i=0; i<FRAME_NUM; i++)
    {
        if( FrameTable[i].pid == pcb.getPID() )
        {
            FrameTable[i].pid = FP_NONE;
            FrameTable[i].pnum = FP_NONE;
        }
    }
}

void PrintLog(QString log)
{
    cout << log.toStdString() << endl;
}

void PrintPageMap(int pid, int page, int frame)
{
    QString s = "Task" + QString::number(pid) + " : ";

    s += "Page" + QString::number(page) + " ==> Frame" + QString::number(frame);

    cout << s.toStdString() << endl;
}

void PrintFatalError(QString s, int pid, int page)
{
    s += " Task" + QString::number(pid) + ": Page" + QString::number(page);

    cout << s.toStdString() << endl;

    QCoreApplication::exit(-2);
}

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    int index = 0;

    qsrand(time(NULL));

    TaskTable.append(new PCB(1));

    PrintLog("Task Page Serial:");

    for(int i=0; i<TaskTable.count(); i++)
    {
        TaskTable[i]->printPageSerial();
    }

    PrintLog("==== Running ====");

    while( true )
    {
        if( TaskTable[index]->running() )
        {
            AccessPage(*TaskTable[index]);
        }

        index = (index + 1) % TaskTable.count();

        cin.get();
    }

    return a.exec();
}

Achieve results

It can be seen from the experimental results that the pages are randomly generated. In the process of page request exchange, the queue head is moved out according to the queue

Goal 3: implement LRU page exchange algorithm


code implementation

#include <QtCore/QCoreApplication>
#include <QList>
#include <QQueue>
#include <iostream>
#include <ctime>

using namespace std;

#define PAGE_NUM  (0xFF + 1)
#define FRAME_NUM (0x04)
#define FP_NONE   (-1)

struct FrameItem
{
    int pid;    // the task which use the frame
    int pnum;   // the page which the frame hold
    int ticks;  // the ticks to mark the usage frequency

    FrameItem()
    {
        pid = FP_NONE;
        pnum = FP_NONE;
        ticks = 0xFF;
    }
};

class PageTable
{
    int m_pt[PAGE_NUM];
public:
    PageTable()
    {
        for(int i=0; i<PAGE_NUM; i++)
        {
            m_pt[i] = FP_NONE;
        }
    }

    int& operator[] (int i)
    {
        if( (0 <= i) && (i < length()) )
        {
            return m_pt[i];
        }
        else
        {
            QCoreApplication::exit(-1);
            return m_pt[0]; // for avoid warning
        }
    }

    int length()
    {
        return PAGE_NUM;
    }
};

class PCB
{
    int m_pid;               // task id
    PageTable m_pageTable;   // page table for the task
    int* m_pageSerial;       // simulate the page serial access
    int m_pageSerialCount;   // page access count
    int m_next;              // the next page index to access
public:
    PCB(int pid)
    {
        m_pid = pid;
        m_pageSerialCount = qrand() % 5 + 5;
        m_pageSerial = new int[m_pageSerialCount];

        for(int i=0; i<m_pageSerialCount; i++)
        {
            m_pageSerial[i] = qrand() % 8;
        }

        m_next = 0;
    }

    int getPID()
    {
        return m_pid;
    }

    PageTable& getPageTable()
    {
        return m_pageTable;
    }

    int getNextPage()
    {
        int ret = m_next++;

        if( ret < m_pageSerialCount )
        {
            ret = m_pageSerial[ret];
        }
        else
        {
            ret = FP_NONE;
        }

        return ret;
    }

    bool running()
    {
        return (m_next < m_pageSerialCount);
    }

    void printPageSerial()
    {
        QString s = "";

        for(int i=0; i<m_pageSerialCount; i++)
        {
            s += QString::number(m_pageSerial[i]) + " ";
        }

        cout << ("Task" + QString::number(m_pid) + " : " + s).toStdString() << endl;
    }

    ~PCB()
    {
        delete[] m_pageSerial;
    }
};

FrameItem FrameTable[FRAME_NUM];
QList<PCB*> TaskTable;
QQueue<int> MoveOut;

int GetFrameItem();
void AccessPage(PCB& pcb);
int RequestPage(int pid, int page);
int SwapPage();
void ClearFrameItem(PCB& pcb);
void ClearFrameItem(int frame);
int Random();
int FIFO();
int LRU();
void PrintLog(QString log);
void PrintPageMap(int pid, int page, int frame);
void PrintFatalError(QString s, int pid, int page);

int GetFrameItem()
{
    int ret = FP_NONE;

    for(int i=0; i<FRAME_NUM; i++)
    {
        if( FrameTable[i].pid == FP_NONE )
        {
            ret = i;
            break;
        }
    }

    return ret;
}

void AccessPage(PCB& pcb)
{
    int pid = pcb.getPID();
    PageTable& pageTable = pcb.getPageTable();
    int page = pcb.getNextPage();

    if( page != FP_NONE )
    {
        PrintLog("Access Task" + QString::number(pid) + " for Page" + QString::number(page));

        if( pageTable[page] != FP_NONE )
        {
            PrintLog("Find target page in page table.");
            PrintPageMap(pid, page, pageTable[page]);
        }
        else
        {
            PrintLog("Target page is NOT found, need to request page ...");

            pageTable[page] = RequestPage(pid, page);

            if( pageTable[page] != FP_NONE )
            {
                PrintPageMap(pid, page, pageTable[page]);
            }
            else
            {
                PrintFatalError("Can NOT request page from disk...", pid, page);
            }
        }

        FrameTable[pageTable[page]].ticks++;//Visit page + 1
    }
    else
    {
        PrintLog("Task" + QString::number(pid) + " is finished!");
    }
}

int RequestPage(int pid, int page)
{
    int frame = GetFrameItem();

    if( frame != FP_NONE )
    {
        PrintLog("Get a frame to hold page content: Frame" + QString::number(frame));
    }
    else
    {
        PrintLog("No free frame to allocate, need to swap page out.");

        frame = SwapPage();

        if( frame != FP_NONE )
        {
            PrintLog("Succeed to swap lazy page out.");
        }
        else
        {
            PrintFatalError("Failed to swap page out.", pid, FP_NONE);
        }
    }

    PrintLog("Load content from disk to Frame" + QString::number(frame));

    FrameTable[frame].pid = pid;
    FrameTable[frame].pnum = page;
    FrameTable[frame].ticks = 0xFF;

    MoveOut.enqueue(frame);//Insert page box number

    return frame;
}

void ClearFrameItem(int frame)
{
    FrameTable[frame].pid = FP_NONE;
    FrameTable[frame].pnum = FP_NONE;

    for(int i=0, f=0; (i<TaskTable.count()) && !f; i++)
    {
        PageTable& pt = TaskTable[i]->getPageTable();

        for(int j=0; j<pt.length(); j++)
        {
            if( pt[j] == frame )
            {
                pt[j] = FP_NONE;
                f = 1;
                break;
            }
        }
    }
}

int Random()
{
    // just random select
    int obj = qrand() % FRAME_NUM;

    PrintLog("Random select a frame to swap page content out: Frame" + QString::number(obj));
    PrintLog("Write the selected page content back to disk.");

    ClearFrameItem(obj);

    return obj;
}

int FIFO()//FIFO implementation
{
    // select the first page in memory to move out
    int obj = MoveOut.dequeue();//Out of queue operation

    PrintLog("Select a frame to swap page content out: Frame" + QString::number(obj));
    PrintLog("Write the selected page content back to disk.");

    ClearFrameItem(obj);

    return obj;
}

int LRU()
{
    int obj = 0;
    int ticks = FrameTable[obj].ticks;
    QString s = "";

    for(int i=0; i<FRAME_NUM; i++)//Select the smallest page box
    {
        s += "Frame" + QString::number(i) + " : " + QString::number(FrameTable[i].ticks) + "    ";

        if( ticks > FrameTable[i].ticks )
        {
            ticks = FrameTable[i].ticks;
            obj = i;
        }
    }

    PrintLog(s);
    PrintLog("Select the LRU frame page to swap content out: Frame" + QString::number(obj));
    PrintLog("Write the selected page content back to disk.");

    return obj;
}

int SwapPage()
{
    return LRU();
}

void ClearFrameItem(PCB& pcb)
{
    for(int i=0; i<FRAME_NUM; i++)
    {
        if( FrameTable[i].pid == pcb.getPID() )
        {
            FrameTable[i].pid = FP_NONE;
            FrameTable[i].pnum = FP_NONE;
        }
    }
}

void PrintLog(QString log)
{
    cout << log.toStdString() << endl;
}

void PrintPageMap(int pid, int page, int frame)
{
    QString s = "Task" + QString::number(pid) + " : ";

    s += "Page" + QString::number(page) + " ==> Frame" + QString::number(frame);

    cout << s.toStdString() << endl;
}

void PrintFatalError(QString s, int pid, int page)
{
    s += " Task" + QString::number(pid) + ": Page" + QString::number(page);

    cout << s.toStdString() << endl;

    QCoreApplication::exit(-2);
}

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    int index = 0;

    qsrand(time(NULL));

    TaskTable.append(new PCB(1));
    //TaskTable.append(new PCB(2));

    PrintLog("Task Page Serial:");

    for(int i=0; i<TaskTable.count(); i++)
    {
        TaskTable[i]->printPageSerial();
    }

    PrintLog("==== Running ====");

    while( true )
    {
        for(int i=0; i<FRAME_NUM; i++)//Reduce the page count by one and trigger the interrupt every other time interval
        {
            FrameTable[i].ticks--;
        }

        if( TaskTable.count() > 0 )
        {
            if( TaskTable[index]->running() )
            {
                AccessPage(*TaskTable[index]);
            }
            else
            {
                PrintLog("Task" + QString::number(TaskTable[index]->getPID()) + " is finished!");

                PCB* pcb = TaskTable[index];

                TaskTable.removeAt(index);

                ClearFrameItem(*pcb);

                delete pcb;
            }
        }

        if( TaskTable.count() > 0 )
        {
            index = (index + 1) % TaskTable.count();
        }

        cin.get();
    }

    return a.exec();
}

Operation results

It can be seen from the experimental results that in the process of page exchange, the page frame with the least number of page frame accesses is removed
Summary
1. In the experiment, page frame table, page table and task structure are interrelated
2. When page box allocation and page box recycling need to cut off the two-way association between page box table and page table
3. Task structure is the internal representation of tasks, including private page tables
4. Both FIFO and LRU page exchange algorithms select Page removal from the perspective of probability






Tags: Qt

Posted on Fri, 15 May 2020 04:19:19 -0700 by lupld