diff options
author | Adam NAILI | 2018-04-02 16:14:45 +0200 |
---|---|---|
committer | Adam NAILI | 2018-04-02 16:14:45 +0200 |
commit | 3dc844c1dfea604bc43890794a5cbc4c5fdef89d (patch) | |
tree | 3599db4a41125f3934d2d9ebc7aa6eaed2a9aaab /fifo.py | |
parent | 0441d28435e8db1d60c1ae30c81e3a54f12149c8 (diff) | |
download | mempager-simulator-3dc844c1dfea604bc43890794a5cbc4c5fdef89d.tar.gz |
PageException created and LRU,Second Chance Handling
Diffstat (limited to 'fifo.py')
-rw-r--r-- | fifo.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -4,6 +4,7 @@ | |||
4 | # Pacien TRAN-GIRARD et Adam NAILI | 4 | # Pacien TRAN-GIRARD et Adam NAILI |
5 | 5 | ||
6 | from mem import Memory | 6 | from mem import Memory |
7 | from pageexception import * | ||
7 | 8 | ||
8 | 9 | ||
9 | class FifoPaginator: | 10 | class FifoPaginator: |
@@ -18,7 +19,7 @@ class FifoPaginator: | |||
18 | return overwritten | 19 | return overwritten |
19 | 20 | ||
20 | def load(self, page): | 21 | def load(self, page): |
21 | if not self.mem.page_in_range(page): raise IndexError | 22 | if not self.mem.page_in_range(page): raise PageException |
22 | if page in self.mem.main: return | 23 | if page in self.mem.main: return |
23 | if page in self.mem.virt: self.mem.remove_virt(page) | 24 | if page in self.mem.virt: self.mem.remove_virt(page) |
24 | overwritten = self._put_main(page) | 25 | overwritten = self._put_main(page) |