<?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_2010.07.12</id>
	<title>ProvaTeorica 2010.07.12 - 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_2010.07.12"/>
	<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=ProvaTeorica_2010.07.12&amp;action=history"/>
	<updated>2026-06-30T19:41:57Z</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_2010.07.12&amp;diff=574&amp;oldid=prev</id>
		<title>Mrta: Created page with &quot;== Esercizio 2 ==  Fatto dal professore  &lt;syntaxhighlight lang=&quot;Python&quot;&gt;  # Esercizio 2: Message passing con priorita'. Sia dato un servizio di message passing asincrono. Si i...&quot;</title>
		<link rel="alternate" type="text/html" href="https://so.v2.cs.unibo.it/wiki/index.php?title=ProvaTeorica_2010.07.12&amp;diff=574&amp;oldid=prev"/>
		<updated>2014-04-14T15:36:34Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Esercizio 2 ==  Fatto dal professore  &amp;lt;syntaxhighlight lang=&amp;quot;Python&amp;quot;&amp;gt;  # Esercizio 2: Message passing con priorita&amp;#039;. Sia dato un servizio di message passing asincrono. Si i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Esercizio 2 ==&lt;br /&gt;
&lt;br /&gt;
Fatto dal professore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Esercizio 2: Message passing con priorita'. Sia dato un servizio di message passing asincrono. Si implementi un servizio&lt;br /&gt;
# di message passing con priorita' senza fare uso di processi server. Il nuovo servizio ha due chiamate psend(dest, prio,&lt;br /&gt;
# msg) e precv(sender). La precv consente la ricezione da chiunque (sender==*). Quando un processo P chiama la precv&lt;br /&gt;
# questa deve restituire il messaggio di massima priorita' fra quelli spediti dal sender specificato a P o sospendere il&lt;br /&gt;
# processo se non ce ne sono in attesa. (suggerimento: se serve si puo' usare la funzione getpid() che restituisce&lt;br /&gt;
# l'identificativo del processo chiamante).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
psend(dest, pio, msg)&lt;br /&gt;
  asend(dest,(MSG,getpid(),prio,msg))&lt;br /&gt;
&lt;br /&gt;
precv(sender)&lt;br /&gt;
  asend(getpid,(NULLTAG,getpid(),NULL,NULL))&lt;br /&gt;
  do:&lt;br /&gt;
    (tag,senderx,prio,msg)=arev(*)&lt;br /&gt;
    if(tag==MSG):&lt;br /&gt;
      msgdb.add(senderx,prio,msg)&lt;br /&gt;
    while tag!=NULLTAG.&lt;br /&gt;
    while (m=msgdb.getmaxprio(sender))=None:&lt;br /&gt;
      (tag,senderx,prio,msg)=arev(*)&lt;br /&gt;
      msgdb.add(senderx,prio,msg)&lt;br /&gt;
    return m&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mrta</name></author>
	</entry>
</feed>