<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://so.v2.cs.unibo.it/wiki/index.php?action=history&amp;feed=atom&amp;title=ProvaTeorica_2011.02.11</id>
	<title>ProvaTeorica 2011.02.11 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://so.v2.cs.unibo.it/wiki/index.php?action=history&amp;feed=atom&amp;title=ProvaTeorica_2011.02.11"/>
	<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=ProvaTeorica_2011.02.11&amp;action=history"/>
	<updated>2026-05-14T06:27:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://so.v2.cs.unibo.it/wiki/index.php?title=ProvaTeorica_2011.02.11&amp;diff=446&amp;oldid=prev</id>
		<title>Stefano 92 at 18:14, 16 March 2014</title>
		<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=ProvaTeorica_2011.02.11&amp;diff=446&amp;oldid=prev"/>
		<updated>2014-03-16T18:14:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:14, 16 March 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot; &gt;Line 37:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 37:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;-furt&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Stefano 92</name></author>
	</entry>
	<entry>
		<id>https://so.v2.cs.unibo.it/wiki/index.php?title=ProvaTeorica_2011.02.11&amp;diff=445&amp;oldid=prev</id>
		<title>Stefano 92: Created page with &quot;Esercizio 1  &lt;syntaxhighlight lang=&quot;C&quot;&gt; /*Esercizio 1: Il monitor lifocs che lo studente deve implementare, realizza una critical section LIFO. I processi per usare  la critic...&quot;</title>
		<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=ProvaTeorica_2011.02.11&amp;diff=445&amp;oldid=prev"/>
		<updated>2014-03-16T18:13:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Esercizio 1  &amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt; /*Esercizio 1: Il monitor lifocs che lo studente deve implementare, realizza una critical section LIFO. I processi per usare  la critic...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Esercizio 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
/*Esercizio 1: Il monitor lifocs che lo studente deve implementare, realizza una critical section LIFO. I processi per usare &lt;br /&gt;
la critical section LIFO usano il seguente protocollo:&lt;br /&gt;
n1=lifocs.enter()&lt;br /&gt;
…. codice critico&lt;br /&gt;
n2=lifocs.exit()&lt;br /&gt;
quando un processo rilascia la sezione critica e ci sono processi in attesa di entrare, deve venir assegnata la sezione &lt;br /&gt;
critica al processo che ha fatto l'ultima richiesta (in ordine di tempo).&lt;br /&gt;
Le funzioni enter e exit devono dare come valore di ritorno il numero di processi in attesa di entrare nella sezione critica.&lt;br /&gt;
I valori n1 e n2 sono correlati fra loro?*/&lt;br /&gt;
&lt;br /&gt;
monitor lifocs&lt;br /&gt;
{&lt;br /&gt;
	int inc=0;&lt;br /&gt;
	bool occupy=false;&lt;br /&gt;
	condition *pila;&lt;br /&gt;
&lt;br /&gt;
	procedure entry enter()&lt;br /&gt;
	{&lt;br /&gt;
		inc++;&lt;br /&gt;
		if(occupy)&lt;br /&gt;
			pila[k-1].wait();&lt;br /&gt;
		inc--;&lt;br /&gt;
		occupy=true;&lt;br /&gt;
		return i;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	procedure entry exit()&lt;br /&gt;
	{&lt;br /&gt;
		occupy=false;&lt;br /&gt;
		if(k!=0)&lt;br /&gt;
			pila[k-1].signal();&lt;br /&gt;
		return k;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stefano 92</name></author>
	</entry>
</feed>