Sistema parte doc

This commit is contained in:
s03529 2025-04-03 20:25:41 +02:00
parent 5fcfd880dd
commit c475d8bf7b
13 changed files with 90 additions and 42 deletions

View File

@ -1,6 +1,16 @@
<corpo>
<p>aereo = record</p>
<p>aggiornato da processi "scrittori"</p>
<p>possono accedere dei processi "lettori"</p>
<img src="./slide/5/torredicontrollo.webp" style="width: 50vw" />
<imgbox>
<span>aereo = record</span>
<img src="./slide/5/aereo.jpg" />
</imgbox>
<imgbox>
<span>aggiornato da processi "scrittori"</span>
<img src="./slide/5/update.jpg" />
</imgbox>
<imgbox>
<span>possono accedere dei processi "lettori"</span>
<img src="./slide/5/libri.jpg" />
</imgbox>
</corpo>
<autore>Lorenzo Viola</autore>

View File

@ -1,5 +1,12 @@
<corpo>
<p>i lettori possono lavorare in contemporanea</p>
<p>gli "scrittori" devono avere accesso individuale per evitare il caos</p>
<img src="./slide/5/bagni.jpg" style="width: 40vw" />
<imgbox>
<span>i lettori possono lavorare in contemporanea</span>
<img src="./slide/5/bagnofemmine.png" />
</imgbox>
<imgbox>
<span>gli "scrittori" devono avere accesso individuale per evitare il caos</span>
<img src="./slide/5/bagnomaschi.png" />
</imgbox>
</corpo>
<autore>Lorenzo Viola</autore>

View File

@ -4,6 +4,7 @@
<p>tanti aerei -dati locali del monitor</p>
<p>i tempi di lettura e scrittura sono bassi ridurremo il tempo della voce del monitor</p>
<p>se molti lettori puntano a un record cè il rischio che la scrittura non aggiorni mai</p>
<img src="./slide/5/infinito.jpg" style="height: 10vw" />
<p>la soluzione sarà di mettere in attesa la scrittura e i lettore non potrà entrare nel record se cè uno scrittore in attesa, per tanto, anche gli stessi lettori in attesa dovranno iniziare prima di uno scrittore per evitare la mutua esclusione</p>
</corpo>
<autore>Lorenzo Viola</autore>

View File

@ -1,42 +1,49 @@
<style>
corpo {
--indentazione: 2;
width: 90%;
}
</style>
<corpo>
<small>
<codeblock>
<name>readers and writers</name>: <kw>monitor</kw><br />
<idt></idt><kw>begin</kw> <name>readercount</name> : integer;<br />
<idt></idt><idt></idt><name>busy</name>: Boolean;<br />
<idt></idt><idt></idt><name>OKtoread</name>, <name>OKtowrite</name>:condition;<br />
<br />
<idt></idt><idt></idt><kw>procedure</kw> <name>startread</name>;<br />
<idt></idt><idt></idt><idt></idt><kw>begin</kw><br />
<idt></idt><idt></idt><idt></idt><idt></idt><kw>if</kw> <name>busy</name> V <name>OKtowrite</name>.queue <kw>then</kw> <name>OKtoread</name>.wait;<br />
<idt></idt><idt></idt><idt></idt><idt></idt><name>readercount</name> := <name>readercount</name> + 1;<br />
<idt></idt><idt></idt><idt></idt><idt></idt><name>OKtoread</name>.signal;<br />
<idt></idt><idt></idt><idt></idt><idt></idt><comment>// Quando un lettore può iniziare, tutti possono</comment><br />
<idt></idt><idt></idt><idt></idt><kw>end</kw> <name>startread</name>;<br />
<br />
<idt></idt><idt></idt><kw>procedure</kw> <name>endread</name>;<br />
<idt></idt><idt></idt><idt></idt><kw>begin</kw><br />
<idt></idt><idt></idt><idt></idt><idt></idt><name>readercount</name> := <name>readercount</name> -- 1 ;<br />
<idt></idt><idt></idt><idt></idt><idt></idt><kw>if</kw> <name>readercount</name> = 0 <kw>then</kw> <name>OKtowrite</name>.signal<br />
<idt></idt><idt></idt><idt></idt><kw>end</kw> <name>endread</name>;<br />
<br />
<idt></idt><idt></idt><kw>procedure</kw> <name>startwrite</name>;<br />
<idt></idt><idt></idt><idt></idt><kw>begin</kw><br />
<idt></idt><idt></idt><idt></idt><idt></idt><kw>if</kw> <name>readercount</name> != 0 V <name>busy</name> <kw>then</kw> <name>OKtowrite</name>.wait<br />
<idt></idt><idt></idt><idt></idt><idt></idt><name>busy</name> := true<br />
<idt></idt><idt></idt><idt></idt><kw>end</kw> <name>startwrite</name>;<br />
<br />
<idt></idt><idt></idt><kw>procedure</kw> <name>endwrite</name>;<br />
<idt></idt><idt></idt><idt></idt><kw>begin</kw><br />
<idt></idt><idt></idt><idt></idt><idt></idt><name>busy</name> := false;<br />
<idt></idt><idt></idt><idt></idt><idt></idt><kw>if</kw> <name>OKtoread</name>.queue <kw>then</kw> <name>OKtoread</name>.signal<br />
<idt></idt><idt></idt><idt></idt><idt></idt><kw>else</kw> <name>OKtowrite</name>.signal<br />
<idt></idt><idt></idt><idt></idt><kw>end</kw> <name>endwrite</name>;<br />
<br />
<idt></idt><idt></idt><name>readercount</name> := 0;<br />
<idt></idt><idt></idt><name>busy</name> := false;<br />
<idt></idt><kw>end</kw> <name>readers and writers</name>;<br />
</codeblock>
<codeblock>
<name>readers and writers</name>: <kw>monitor</kw> <comment>// il monitor dei lettori e scrittori</comment><br />
<idt></idt><kw>begin</kw> <name>readercount</name> : integer;<br />
<idt></idt><idt></idt><name>busy</name>: Boolean; <comment>// detto prima del controllo se qualcuno scrive</comment><br />
<idt></idt><idt></idt><name>OKtoread</name>, <name>OKtowrite</name>: condition; <comment>// condizioni</comment><br />
<br />
<idt></idt><idt></idt><kw>procedure</kw> <name>startread</name>; <comment>// inizia la procedura</comment><br />
<idt></idt><idt></idt><idt></idt><kw>begin</kw><br />
<idt></idt><idt></idt><idt></idt><idt></idt><kw>if</kw> <name>busy</name> || <name>OKtowrite</name>.queue <kw>then</kw> <name>OKtoread</name>.wait; <comment>// controlla se c'è una scrittura in attesa per bloccare il prossimo lettore</comment><br />
<idt></idt><idt></idt><idt></idt><idt></idt><name>readercount</name> := <name>readercount</name> + 1;<br />
<idt></idt><idt></idt><idt></idt><idt></idt><name>OKtoread</name>.signal;<br />
<idt></idt><idt></idt><idt></idt><idt></idt><comment>// dopo che un lettore inizia iniziano quelli in coda dopo</comment><br />
<idt></idt><idt></idt><idt></idt><kw>end</kw> <name>startread</name>; <comment>// fine iniziolettura</comment><br />
<br />
<idt></idt><idt></idt><kw>procedure</kw> <name>endread</name>; <comment>// finelettura</comment><br />
<idt></idt><idt></idt><idt></idt><kw>begin</kw><br />
<idt></idt><idt></idt><idt></idt><idt></idt><name>readercount</name> := <name>readercount</name> - 1 ; <comment>// leva i lettori in coda</comment><br />
<idt></idt><idt></idt><idt></idt><idt></idt><kw>if</kw> <name>readercount</name> = 0 <kw>then</kw> <name>OKtowrite</name>.signal <comment>// appena finiscono si scrive</comment><br />
<idt></idt><idt></idt><idt></idt><kw>end</kw> <name>endread</name>; <comment>// fine finelettura</comment><br />
<br />
<idt></idt><idt></idt><kw>procedure</kw> <name>startwrite</name>; <comment>// inizio scrittura</comment><br />
<idt></idt><idt></idt><idt></idt><kw>begin</kw><br />
<idt></idt><idt></idt><idt></idt><idt></idt><kw>if</kw> <name>readercount</name> != 0 || <name>busy</name> <kw>then</kw> <name>OKtowrite</name>.wait <comment>// se ci sono lettori aspetta la scrittura</comment><br />
<idt></idt><idt></idt><idt></idt><idt></idt><name>busy</name> := true<br />
<idt></idt><idt></idt><idt></idt><kw>end</kw> <name>startwrite</name>; <comment>// fine inizioscrittura</comment><br />
<br />
<idt></idt><idt></idt><kw>procedure</kw> <name>endwrite</name>; <comment>// procedura finescrittura</comment><br />
<idt></idt><idt></idt><idt></idt><kw>begin</kw><br />
<idt></idt><idt></idt><idt></idt><idt></idt><name>busy</name> := false;<br />
<idt></idt><idt></idt><idt></idt><idt></idt><kw>if</kw> <name>OKtoread</name>.queue <kw>then</kw> <name>OKtoread</name>.signal<br />
<idt></idt><idt></idt><idt></idt><idt></idt><kw>else</kw> <name>OKtowrite</name>.signal <comment>// continua a fare entrare in scrittura</comment><br />
<idt></idt><idt></idt><idt></idt><kw>end</kw> <name>endwrite</name>; <comment>// fine finescrittura</comment><br />
<br />
<idt></idt><idt></idt><name>readercount</name> := 0;<br />
<idt></idt><idt></idt><name>busy</name> := false;<br />
<idt></idt><kw>end</kw> <name>readers and writers</name>; <comment>// finito tutto</comment><br />
</codeblock>
</small>
</corpo>
<autore>Lorenzo Viola</autore>

BIN
slide/5/aereo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
slide/5/bagni.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
slide/5/bagnofemmine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
slide/5/bagnomaschi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
slide/5/infinito.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

BIN
slide/5/libri.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

BIN
slide/5/update.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

View File

@ -118,3 +118,26 @@ kw {
comment {
color: #494949;
}
imgbox {
height: calc(var(--dimensione-corpo) * 3);
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin-top: 1vw;
margin-bottom: 1vw;
}
imgbox span {
margin-top: var(--dimensione-corpo);
margin-bottom: var(--dimensione-corpo);
}
imgbox img {
height: 100%;
margin-left: 2vw;
}