<html> <head> <title>SO 12-1-99</title> </head> <body> <p><b><font face="Arial"><font size=+1>Compito di Sistemi Operativi, Prof. Mancini - 12 gennaio 1999</font></font></b></center> <p> <hr> <p><b><font size=+1>1.</font></b> (punti: -1,4) <p>Esistono sistemi operativi dove, <ol TYPE="a"> <li> alcuni processi sono permanenti, cioè definiti staticamente come componenti del sistema;</li> <li> alcuni processi sono permanenti, cioè definiti dinamicamente come componenti del sistema;</li> <li> tutti i processi sono permanenti, cioè definiti staticamente come componenti del sistema;</li> <li> tutti i processi sono permanenti, cioè definiti dinamicamente come componenti del sistema;</li> <li> nessun processo e' permanente, cioè definito staticamente come componente del sistema;</li> <li> nessun processo e' permanente, cioè definito dinamicamente come componente del sistema;</li> <li> nessuna delle affermazioni precedenti è corretta.</li> </ol> <b><font size=+1>2.</font></b> (punti: -1,4) <p>Nel sistema Unix la chiamata di sistema denominata fork eseguita dal processo P<sub>i</sub>: <ol TYPE="a"> <li> genera un processo P<sub>j</sub> che e' una copia di P<sub>i</sub>, e restituisce a P<sub>i</sub> l'indice zero e a P<sub>j</sub> il file-descriptor di P<sub>i</sub>. I processi P<sub>i</sub> e P<sub>j</sub> hanno descrittori e immagini in memoria distinte.</li> <li> genera un processo P<sub>j</sub> che e' una copia di P<sub>i</sub>, e restituisce a P<sub>i</sub> il file-descriptor di P<sub>j</sub> e a P<sub>j</sub> l'indice zero. I processi P<sub>i</sub> e P<sub>j</sub> hanno descrittori e immagini in memoria distinte.</li> <li> genera un processo P<sub>j</sub> che e' una copia di P<sub>i</sub>, e restituisce a P<sub>i</sub> l'indice zero e a P<sub>j</sub> il PID di P<sub>i</sub>. I processi P<sub>i</sub> e P<sub>j</sub> hanno descrittori e immagini in memoria distinte.</li> <li> genera un processo P<sub>j</sub> che e' una copia di P<sub>i</sub>, e restituisce a P<sub>i</sub> l'indice zero e a P<sub>j</sub> il PID di P<sub>i</sub>. I processi P<sub>i</sub> e P<sub>j</sub> non hanno descrittori e immagini in memoria distinte.</li> <li> genera un processo P<sub>j</sub> che e' una copia di P<sub>i</sub>, e restituisce a P<sub>i</sub> il PID di P<sub>j</sub> e a P<sub>j</sub> l'indice zero. I processi P<sub>i</sub> e P<sub>j</sub> hanno descrittori e immagini in memoria distinte.</li> <li> genera un processo P<sub>j</sub> che e' una copia di P<sub>i</sub>, e restituisce a P<sub>i</sub> il PID di P<sub>j</sub> e a P<sub>j</sub> l'indice zero. I processi P<sub>i</sub> e P<sub>j</sub> non hanno descrittori e immagini in memoria distinte.</li> <li> consente dopo la generazione l'avanzamento dei due processi P<sub>i</sub> e P<sub>j</sub> eseguendo il medesimo programma a partire da un indirizzo logico comune;</li> <li> consente dopo la generazione l'avanzamento dei due processi P<sub>i</sub> e P<sub>j</sub> eseguendo il medesimo programma a partire da un indirizzo fisico comune;</li> <li> nessuna delle affermazioni precedenti e' corretta.</li> </ol> <b><font size=+1>3.</font></b> (punti: -1,4) <p>Le seguenti quattro condizioni (1) le risorse sono seriali, (2) le risorse sono non prerilasciabili, (3) le risorse sono gestite con richiesta bloccante, e (4) il sistema raggiunge uno stato di attesa circolare, solo collettivamente: <ol TYPE="a"> <li> necessarie affinche' si verifichi lo stallo;</li> <li> sufficienti affinche' si verifichi lo stallo;</li> <li> necessarie affinche' si verifichi l'attesa indefinita;</li> <li> sufficienti affinche' si verifichi l'attesa indefinita;</li> <li> necessarie e sufficienti affinche' si verifichi l'attesa indefinita;</li> <li> nessuna delle affermazioni precedenti e' corretta.</li> </ol> <b><font size=+1>4.</font></b> (punti: -1,4) <p>Nei sistemi operativi l'identificazione degli utenti avviene tramite una parola d'ordine password. Ipotizzando parole d'ordine di 8 caratteri, scelti in un alfabeto di 80 simboli (lettere maiuscole, minuscole, cifre decimali e caratteri speciali): <ol TYPE="a"> <li> le possibili combinazioni sarebbero 8<sup>80</sup> e per scoprire la vera parola d'ordine bisognerebbe provarne in media la meta';</li> <li> le possibili combinazioni sarebbero 80<sup>8</sup> e per scoprire la vera parola d'ordine bisognerebbe provarne in media la meta';</li> <li> le possibili combinazioni sarebbero 80 * 8 e per scoprire la vera parola d'ordine bisognerebbe provarne in media la radice quadrata;</li> <li> le possibili combinazioni sarebbero 8<sup>80</sup> e per scoprire la vera parola d'ordine bisognerebbe provarne in media un numero lineare;</li> <li> le possibili combinazioni sarebbero 80<sup>8</sup> e per scoprire la vera parola d'ordine bisognerebbe provarne in media il doppio;</li> <li> le possibili combinazioni sarebbero 80 * 8 e per scoprire la vera parola d'ordine bisognerebbe provarne in media un numero esponenziale;</li> <li> nessuna delle affermazioni precedenti è corretta.</li> </ol> <b><font size=+1>5.</font></b> (punti: 6) <p>Illustrare in al più 60 parole il fenomeno conosciuto sotto il nome di thrashing <p><b><font size=+1>6.</font></b> Considerare un insieme di cinque processi P1, P2, P3, P4, P5 con i seguenti tempi di arrivo e tempi di esecuzione in millisecondi: <br> <table BORDER CELLPADDING=4 WIDTH="373" > <tr> <td VALIGN=TOP WIDTH="22%" BGCOLOR="#C0C0C0"> <center><b>Processo</b></center> </td> <td VALIGN=TOP WIDTH="33%" BGCOLOR="#C0C0C0"> <center><b>Tempo di arrivo</b></center> </td> <td VALIGN=TOP WIDTH="46%" BGCOLOR="#C0C0C0"> <center><b>Tempo di esecuzione</b></center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="22%" BGCOLOR="#C0C0C0"> <center><b>P1</b></center> </td> <td VALIGN=TOP WIDTH="33%"> <center>0</center> </td> <td VALIGN=TOP WIDTH="46%"> <center>20</center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="22%" BGCOLOR="#C0C0C0"> <center><b>P2</b></center> </td> <td VALIGN=TOP WIDTH="33%"> <center>8</center> </td> <td VALIGN=TOP WIDTH="46%"> <center>5</center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="22%" BGCOLOR="#C0C0C0"> <center><b>P3</b></center> </td> <td VALIGN=TOP WIDTH="33%"> <center>3</center> </td> <td VALIGN=TOP WIDTH="46%"> <center>12</center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="22%" BGCOLOR="#C0C0C0"> <center><b>P4</b></center> </td> <td VALIGN=TOP WIDTH="33%"> <center>10</center> </td> <td VALIGN=TOP WIDTH="46%"> <center>6</center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="22%" BGCOLOR="#C0C0C0"> <center><b>P5</b></center> </td> <td VALIGN=TOP WIDTH="33%"> <center>7</center> </td> <td VALIGN=TOP WIDTH="46%"> <center>8</center> </td> </tr> </table> <dir> <dir><b>a</b> (punti: 4) <p>Assegnare questo insieme di processi ad un processore in base alla politica Shortest Job First. <p><b>b</b> (punti: 2) <p>Calcolare il valor medio del tempo di attesa dei processi. <p><b>c</b> (punti: 2) <p>Calcolare il valor medio del tempo di turnaround dei processi. <br> <br> </dir> </dir> <b><font size=+1>7.</font></b> Considerare la seguente stringa di riferimenti di un processo alla memoria in un sistema con memoria virtuale <p>S = 9 3 1 0 1 3 5 9 15 1 3 6 4 6 5 1 7 4 6 3 <dir> <dir><b>a</b> (punti: 3) <p>Illustrare il comportamento dell'algoritmo Second Chance di sostituzione delle pagine per una memoria fisica di 5 blocchi. Calcolare il numero di page fault che si verificano. <p><b>b</b> (punti: 3) <p>Illustrare il comportamento dell'algoritmo LRU di sostituzione delle pagine per una memoria fisica di 5 blocchi. Calcolare il numero di page fault che si verificano.</dir> </dir> <b><font size=+1>8.</font></b> (punti: 10) <p>Utilizzare le primitive P e V definite sui semafori per realizzare un semplice programma concorrente che possa causare l'attesa indefinita ma non lo stallo dei processi componenti. <p><b><font size=+1>9.</font></b> (punti: 8) <p>Realizzare un Perl script efficiente che legga il contenuto degli archivi passati come parametro e stampi ciascuna linea nello standard output a meno che la linea non sia già stata stampata prima. Si assuma che i dati da leggere non possano essere contenuti completamente in memoria centrale. <br> <br> <p> <hr> <center> <p><b><font face="Arial"><font size=+1>Risultati della prova</font></font></b></center> <p> <hr> <pre><b>1.a,c 2.e,g 3.a,b 4.b</b></pre> <hr> <p><font size=+1><b>5. </b>In caso di gestione di memoria virtuale, il thrashing consiste nella frequente alternanza di caricamenti e scaricamenti di un ristretto numero di pagine di memoria durante l'esecuzione di un processo. Questo fenomeno contribuisce a ridurre la velocita' di avanzamento dei processi.</font> <p> <hr> <p><b><font size=+1>6.</font></b> <p><font face="Courier New"><font size=-1>a) Algoritmo <b>Shortest Job First</b>:</font></font> <br> <table BORDER WIDTH="635" > <tr> <td VALIGN=TOP WIDTH="11%"> <center><b><font face="Courier New"><font size=-1>P<sub>1</sub></font></font></b></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><b><font face="Courier New"><font size=-1>P<sub>3</sub></font></font></b></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><b><font face="Courier New"><font size=-1>P<sub>2</sub></font></font></b></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><b><font face="Courier New"><font size=-1>P<sub>4</sub></font></font></b></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><b><font face="Courier New"><font size=-1>P<sub>3</sub></font></font></b></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><b><font face="Courier New"><font size=-1>P<sub>5</sub></font></font></b></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><b><font face="Courier New"><font size=-1>P<sub>1</sub></font></font></b></center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="11%"> <center><font face="Courier New"><font size=-1>0-3</font></font></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><font face="Courier New"><font size=-1>3-8</font></font></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><font face="Courier New"><font size=-1>8-13</font></font></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><font face="Courier New"><font size=-1>13-19</font></font></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><font face="Courier New"><font size=-1>19-26</font></font></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><font face="Courier New"><font size=-1>26-34</font></font></center> </td> <td VALIGN=TOP WIDTH="11%"> <center><font face="Courier New"><font size=-1>34-51</font></font></center> </td> </tr> </table> <p><font face="Courier New"><font size=-1>b) media tempo di attesa dei processi: <b>64/5</b></font></font> <br><font face="Courier New"><font size=-1>c) turnaround medio: <b>115/5</b></font></font> <p> <hr> <p><b><font size=+1>7.</font></b> <p><b><font size=+1>a.</font></b><font face="Courier New"><font size=-1> Algoritmo <b>Second Chance</b>:</font></font> <br> <table BORDER WIDTH="94" > <tr> <td VALIGN=CENTER WIDTH="31%" HEIGHT="20" BGCOLOR="#00FF00"> </td> <td VALIGN=CENTER WIDTH="69%" HEIGHT="20"> <center><font face="Courier New"><font size=-1>TurnoMS</font></font></center> </td> </tr> </table> <p> <font face="Courier New"><font size=-1>TurnoMS e' inizializzato a 4.</font></font> <br> <table BORDER CELLPADDING=4 WIDTH="681" > <tr> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>9</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>3</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>1</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>0</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>1</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>3</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>5</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>9</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>15</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>1</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>3</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>6</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>4</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>6</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>5</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>1</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>7</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>4</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>6</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>3</font></font></b></center> </td> </tr> <tr> <td VALIGN=CENTER WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>0</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>9<sup>1</sup></font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>9<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>9<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>15<sup>1</sup></font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font size=-1>15<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font size=-1>15<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>15<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>15<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>15<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>15<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>15<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>7<sup>1</sup></font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font size=-1>7<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font size=-1>7<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>7<sup>1</sup></font></font></center> </td> </tr> <tr> <td VALIGN=CENTER WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>1</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>3<sup>1</sup></font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>3<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>3<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>3<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>3<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>3<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>3<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>3<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>5<sup>1</sup></font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font size=-1>5<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>5<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>5<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>5<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>5<sup>0</sup></font></font></center> </td> </tr> <tr> <td VALIGN=CENTER WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>2</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>1<sup>1</sup></font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>1<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>3<sup>1</sup></font></font></font></center> </td> </tr> <tr> <td VALIGN=CENTER WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>3</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>0<sup>1</sup></font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font size=-1>0<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font size=-1>0<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>0<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>0<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>0<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>0<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>0<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>6<sup>1</sup></font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>6<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>6<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>6<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>6<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>6<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>6<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>6<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>6<sup>1</sup></font></font></center> </td> </tr> <tr> <td VALIGN=CENTER WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>4</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>5<sup>1</sup></font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font size=-1>5<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>5<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>5<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>5<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>5<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>4<sup>1</sup></font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#00FF00"> <center><font face="Courier New"><font size=-1>4<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>4<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>4<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>4<sup>0</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>4<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>4<sup>1</sup></font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFFFF"> <center><font face="Courier New"><font size=-1>4<sup>1</sup></font></font></center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"><font face="Courier New"> </font></td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> </tr> </table> <p><font face="Courier New"><font size=-1>Numero page fault: <b>4+7</b></font></font> <p><font face="Courier New"><font size=+1>b. </font><font size=-1>Algoritmo <b>LRU</b> (pag. 469 del Maestrini):</font></font> <br> <table BORDER WIDTH="170" > <tr> <td VALIGN=CENTER WIDTH="17%" BGCOLOR="#FFFF00"><font size=+1> </font></td> <td VALIGN=CENTER WIDTH="83%"> <center><font face="Courier New"><font size=-1>Pagina riferita</font></font></center> </td> </tr> </table> <table BORDER CELLPADDING=7 WIDTH="635" > <tr> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>9</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>3</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>1</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>0</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>1</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>3</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>5</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>9</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>15</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>1</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>3</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>6</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>4</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>6</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>5</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>1</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>7</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>4</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>6</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>3</font></font></b></center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>0</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>9</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>9</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>4</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>4</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>4</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>4</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>4</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font size=-1>4</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>4</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>4</font></font></center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>1</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>3</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>3</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>7</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>7</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>7</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>7</font></font></center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>2</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>1</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>1</font></font></center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>3</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>0</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>0</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>0</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>0</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>0</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>15</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>15</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>15</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>15</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>15</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>15</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>5</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>5</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>5</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>5</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>5</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>3</font></font></font></center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#C0C0C0"> <center><b><font face="Courier New"><font size=-1>4</font></font></b></center> </td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%"><font size=-1> </font></td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>5</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>5</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>5</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>5</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>5</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>6</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>6</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font size=-1>6</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>6</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>6</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>6</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>6</font></font></center> </td> <td VALIGN=TOP WIDTH="5%" BGCOLOR="#FFFF00"> <center><font face="Courier New"><font size=-1>6</font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font size=-1>6</font></font></center> </td> </tr> <tr> <td VALIGN=TOP WIDTH="5%"> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> </td> <td VALIGN=TOP WIDTH="5%"> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> </td> <td VALIGN=TOP WIDTH="5%"> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> <td VALIGN=TOP WIDTH="5%"> </td> <td VALIGN=TOP WIDTH="5%"> </td> <td VALIGN=TOP WIDTH="5%"> <center><font face="Courier New"><font color="#FF0000"><font size=-1>p</font></font></font></center> </td> </tr> </table> <p><font face="Courier New"><font size=-1>Numero page fault: <b>4+7</b></font></font> <p> <hr> <p><b><font size=+1>8. </font></b><font face="Times New Roman,Times">Nel problema dei processi lettori e scrittori in un database puo' avvenire il fenomeno di</font> <br><font face="Times New Roman,Times">attesa indefinita:</font> <br><font face="Times New Roman,Times">Se mentre e' presente un processo lettore nella sezione critica, continuano ad arrivare altri lettori, tutti i processi scrittori dovranno aspettare (attesa indefinita) l'uscita dell'ultimo lettore<sup>(*)</sup> dalla sua sezione critica, rilasciando cosi' la mutua esclusione sul semaforo <b>db</b>.</font> <p><b>semaphore </b>mutex=1, db=1; <br><b>int </b>rc=0; <p><b>void </b>Lettore() <br> { <br> <b>P</b>(mutex); <br> rc++; <br> <b>if </b>(rc==1) <b>P</b>(db); <br> <b>V</b>(mutex); <br> <nop>LetturaDB(); <br> <b>P</b>(mutex); <br> rc--; <br> <b>if </b>(rc==0) <b>V</b>(db); (*) <br> <b>V</b>(mutex); <br> } <p><b>void </b>Scrittore() <br> { <br> <b>P</b>(db); <br> <nop>ScritturaDB(); <br> <b>V</b>(db); <br> } <br> <p> <hr> <p><b><font size=+1>9.</font></b> <br><font face="Courier New"><font size=-1>perl -ne 'print unless $seen{$_}++' archivi</font></font> <p> <hr> <center> <p><b><font face="Arial"><font size=+1>12 gennaio 1999 </font>- </font></b><u><font color="#0000FF"></font></u></center> <p><font size=+1>Si ringraziano i volenterosi studenti <u><font color="#0000FF"><a href="mailto:a.cagnetti@usa.net">Alessandro Cagnetti</a></font></u></font><font size=-2> </font><font size=+1>e <u><font color="#0000FF"><a href="mailto:d.giabbai@flashnet.it">Daniele Giabbai</a></font></u></font> </body> </html>
This topic: Sistemioperativi1
>
12Gennaio1999
Topic revision: r2 - 2002-02-04 - AntonioValletta
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback