Solución de los ejercicios de memoria virtual

De Wiki de Sistemas Operativos
Saltar a: navegación, buscar

NRU

En caso de empate, se emplea LRU.

                                         accesos a páginas

                |   r   |   r   |   w   |   r   |   r   |   r   |   r   |   w   |   w   |   w   |   r   |   r   |
                -------------------------------------------------------------------------------------------------
                |   1   |   3   |   3   |   3   |   4   |   5   |   1   |   2   |   5   |   1   |   3   |   4   |
        ---------------------------------------------------------------------------------------------------------
        |   1   |   1   |   =   |   =   |   =   |   =   |   =   |   =   |   =   |   =   |   =   |   =   |   =   |
        |       |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
        | R | M | 1 | 0 | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = |
        ---------------------------------------------------------------------------------------------------------
marcos  |   2   |       |   3   |   3   |   =   |   =   |   =   |   =   |   =   |   =   |   =   |   =   |   =   |
        |       |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
        | R | M |   |   | 1 | 0 | 1 | 1 | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = | = |
        ---------------------------------------------------------------------------------------------------------
        |   3   |       |       |       |       |   4   |   =   |   =   |   2   |   =   |   =   |   =   |   4   |
        |       |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
        | R | M |   |   |   |   |   |   |   |   | 1 | 0 | = | = | = | = | 1 | 1 | = | = | = | = | = | = | 1 | 0 |
        ---------------------------------------------------------------------------------------------------------
        |   4   |       |       |       |       |       |   5   |   =   |   =   |   5   |   =   |   =   |   =   |
        |       |-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
        | R | M |   |   |   |   |   |   |   |   |   |   | 1 | 0 | = | = | = | = | 1 | 1 | = | = | = | = | = | = |
        ---------------------------------------------------------------------------------------------------------
fallo           |   X   |   X   |       |       |   X   |   X   |       |   X   |       |       |       |   X   |
página          -------------------------------------------------------------------------------------------------

                                              tiempo ->

                                6
talla de fallos de página =  ------ = 0,5
                               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