BufferPool

Transfering data between memory and disk

Buffer Pool Manager

high

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
typedef char byte;
#define 4*1024 PageSize
#define 10 FrameNumber
//In memory

//BufferPool
byte BufferPool [FrameNumber][PageSize];

//PageTable
typedef struct PageTableEntry{
byte* ptr ;
bool dirty ;
bool pin ;
int counter ;
}

byte* PageTable [FrameNumber];
PageTable[0].ptr = BufferPool[3]; // frame0 -> page3
PageTable[0].dirty = false; // Not accessed yet
PageTable[0].pin = true ; // Do not swap the page out
PageTable[0].counter = 0;
...

Allocate strategy

  • Multiple Buffer Pool (each one can have different policies)
  • Pre-fetching

Replacement policies