-
Notifications
You must be signed in to change notification settings - Fork 18
/
pager-predict.c
46 lines (35 loc) · 1.05 KB
/
pager-predict.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* File: pager-predict.c
* Author: Andy Sayler
* http://www.andysayler.com
* Adopted From: Dr. Alva Couch
* http://www.cs.tufts.edu/~couch/
*
* Project: CSCI 3753 Programming Assignment 4
* Create Date: Unknown
* Modify Date: 2012/04/03
* Description:
* This file contains a predictive pageit
* implmentation.
*/
#include <stdio.h>
#include <stdlib.h>
#include "simulator.h"
void pageit(Pentry q[MAXPROCESSES]) {
/* This file contains the stub for a predictive pager */
/* You may need to add/remove/modify any part of this file */
/* Static vars */
static int initialized = 0;
static int tick = 1; // artificial time
/* Local vars */
/* initialize static vars on first run */
if(!initialized){
/* Init complex static vars here */
initialized = 1;
}
/* TODO: Implement Predictive Paging */
fprintf(stderr, "pager-predict not yet implemented. Exiting...\n");
exit(EXIT_FAILURE);
/* advance time for next pageit iteration */
tick++;
}