pre aggiunta parte del doc
This commit is contained in:
parent
318c15cb8a
commit
de9e131969
@ -1,9 +1,9 @@
|
|||||||
<corpo>
|
<corpo>
|
||||||
<h1>I monitor</h1>
|
<h1>I monitor</h1>
|
||||||
<small>
|
<ul>
|
||||||
<p>Pietro Tessarolo</p>
|
<li>Pietro Tessarolo</li>
|
||||||
<p>Enrico Vrabie</p>
|
<li>Enrico Vrabie</li>
|
||||||
<p>Manuel Nichele</p>
|
<li>Manuel Nichele</li>
|
||||||
<p>Lorenzo Viola</p>
|
<li>Lorenzo Viola</li>
|
||||||
</small>
|
</ul>
|
||||||
</corpo>
|
</corpo>
|
||||||
|
42
slide/5/1.html
Normal file
42
slide/5/1.html
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<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>
|
||||||
|
</small>
|
||||||
|
</corpo>
|
||||||
|
<autore>Lorenzo Viola</autore>
|
@ -13,7 +13,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--dimensone-titolo: 5vw;
|
--dimensone-titolo: 4vw;
|
||||||
--dimensione-corpo: 2vw;
|
--dimensione-corpo: 2vw;
|
||||||
--dimensione-autore: 2vw;
|
--dimensione-autore: 2vw;
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ li {
|
|||||||
|
|
||||||
|
|
||||||
small {
|
small {
|
||||||
font-size: 2vw;
|
font-size: 1.25vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
small p {
|
small p {
|
||||||
|
Loading…
Reference in New Issue
Block a user