Solución de los ejercicios de memoria virtual
De Wiki de Sistemas Operativos
NRU
Acceso a 1(R) 3(R) 3(W) 3(R) 4(R) 5(R) 1(R) 2(W) 5(W) 1(W) 3(R) 4(R) página +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ | 1 | = | = | = | = | = | = | = | = | = | = | = | Marco 1 | R=1 | = | = | = | = | = | = | = | = | = | = | = | | M=0 | = | = | = | = | = | = | = | = | M=1 | = | = | +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ | | 3 | = | = | = | = | = | = | = | = | = | = | Marco 2 | | R=1 | = | = | = | = | = | = | = | = | = | = | | | M=0 | M=1 | = | = | = | = | = | = | = | = | = | +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ | | | | | 4 | = | = | 2 | = | = | = | 4 | Marco 3 | | | | | R=1 | = | = | R=1 | = | = | = | R=1 | | | | | | M=0 | = | = | M=1 | = | = | = | M=0 | +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ | | | | | | 5 | = | = | = | = | = | = | Marco 4 | | | | | | R=1 | = | = | = | = | = | = | | | | | | | M=0 | = | = | M=1 | = | = | = | +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ Fallo | | | | | | | | | | | | | de | x | x | | | x | x | | x | | | | x | página | | | | | | | | | | | | | +-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ Tiempo 1 2 3 4 5 6 7 8 9 10 11 12
nº fallos de página 6 Tasa de fallos de página = --------------------- = ---- = 0,5 nº accesos a páginas 12
Sustitución por envejecimiento
Periodo de 4, registro R de 3 bits, desempate: LRU
_________________accesos a página__________________ |_2_|_3_|_3_|_1_||_4_|_5_|_4_|_1_||_5_|_2_|_3_|_4_| ====================================================== 1 | 2 | = | = | = || 2 | 5 | = | = || 5 | = | = | = | |100| = | = | = ||010|100| = | = ||110| = | = | = | m---|---|---|---|---||---|---|---|---||---|---|---|---| a 2 | | 3 | = | = || 3 | = | = | = || 3 | 2 | = | = | r | |100| = | = ||010| = | = | = ||001|100| = | = | c---|---|---|---|---||---|---|---|---||---|---|---|---| o 3 | | | | 1 || 1 | = | = | 1 || 1 | = | = | 4 | s | | | |100||010| = | = |110||011| = | = |100| ---|---|---|---|---||---|---|---|---||---|---|---|---| 4 | | | | || 4 | = | = | = || 4 | = | 3 | = | | | | | ||100| = | = | = ||010| = |100| = | --------------------------------------------------------> t x x x x x x x x 8 tasa fallos pág = ---- 12