Walnut/Distributed Computing/Partial Ordering Of Sent Messages

From Erights

(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by UrxFtl (Talk); changed back to last version by Ansible)
Line 1: Line 1:
[http://farshad-uk.isuisse.com/styles/un-uomo.htm un uomo venuto da molto lontano] [http://levirgule.iespana.es/saeco-nice/ saeco nice] [http://mentalquicksand.ibelgique.com/library/mortacci.htm mortacci] [http://pooponastick.ibelgique.com/description/ereditiere/ ereditiere] [http://mongo42.ibelgique.com/cariola/ cariola] [http://mubathsh.angelfire.com/text/falzoni-sas.htm falzoni sas] [http://muamive.isuisse.com/library/calcio-possibili/ calcio possibili risultati] [http://samuiel.isuisse.com/html/virus-per/ virus per cellulare] [http://ruoj-ruoj.isuisse.com/description/recorder-hard/ recorder hard disk divx] [http://levirgule.iespana.es/happy-center/ happy center abbigliamento] [http://sarahxion.ibelgique.com/blog/jeje-czarne.htm jeje czarne oczy] [http://epbristo.angelfire.com/grondaie/ grondaie] [http://bet-deratos.iespana.es/topic/nintendo-game/ nintendo game cube resident evil 4] [http://mubathsh.angelfire.com/text/www-casavacanze.htm www casavacanze it] [http://sportsgal25.iespana.es/blog/scudetto-ps.htm scudetto ps2] [http://sharkymel.isuisse.com/web/rebel-moves/ rebel moves sheep] [http://songsoutofkey.isuisse.com/view/everybodys-got.htm everybodys got to learn sometime] [http://sharkymel.isuisse.com/web/ricetta-riso/ ricetta riso] [http://dreameradrift.ibelgique.com/small/garage-ermetico/ garage ermetico] [http://farshad-uk.isuisse.com/styles/songs-about.htm songs about jane maroon5] [http://epbristo.angelfire.com/lettore/ lettore 6 1] [http://todomy.ibelgique.com/directory/nokia-/ nokia 3220 edge] [http://pooponastick.ibelgique.com/description/usb-sony/ usb sony] [http://mentalquicksand.ibelgique.com/library/today-s.htm today s people] [http://flameshes.isuisse.com/topic/bbs-ruote/ bbs ruote] [http://mongo42.ibelgique.com/krusenstern-adam/ krusenstern adam johann von] [http://killbox.ibelgique.com/html/camere-olbia.htm camere olbia] [http://sportsgal25.iespana.es/blog/home-theatre.htm home theatre all in one] [http://glchinsy.angelfire.com/topic/nicolosi-srl/ nicolosi srl] [http://grizs.iespana.es/articles/divx-avi.htm divx avi mpeg4] [http://da-kosta.iespana.es/directory/enricomacias.htm enricomacias] [http://sportsgal25.iespana.es/blog/alice-cooper.htm alice cooper prime cuts] [http://akyla-pera.isuisse.com/text/opel-autoradio.htm opel autoradio] [http://glchinsy.angelfire.com/topic/o-mio/ o mio babbino] [http://jkc42.ibelgique.com/compilation-discoradio.htm compilation discoradio] [http://blaleyne.angelfire.com/new/epson-a.htm epson a1] [http://arb-digits.iespana.es/web/video-youssou.htm video youssou ndour] [http://marebeck.angelfire.com/new/teenage-dirtbag/ teenage dirtbag wheatus] [http://levirgule.iespana.es/laura-freddi/ laura freddi nuda] [http://magenta4eva.iespana.es/geosat-travel.htm geosat travel] [http://akyla-pera.isuisse.com/text/carnielli-cx.htm carnielli cx] [http://mubathsh.angelfire.com/text/barbara-durso.htm barbara durso sex sex topless] [http://re-nrevival.isuisse.com/view/incontri-sesso.htm incontri sesso foggia] [http://scsheppe.angelfire.com/articles/downolad-video.htm downolad video nicholas berg] [http://levirgule.iespana.es/doppio-intrigo/ doppio intrigo] [http://pahopewe.angelfire.com/resources/telefono-celulari.htm telefono celulari] [http://arb-digits.iespana.es/web/gloria-trevi.htm gloria trevi] [http://den-namore.isuisse.com/phimonline/ phimonline] [http://scsheppe.angelfire.com/articles/incasso-lavastoviglie.htm incasso lavastoviglie] [http://mentalquicksand.ibelgique.com/library/lavorare-a.htm lavorare a roma] [http://vanisky-love.iespana.es/resources/vieri-veronica/ vieri veronica] [http://jkc42.ibelgique.com/my-immortal.htm my immortal per tastiera] [http://you-edicks.iespana.es/web/epson-photo.htm epson photo stylus color] [http://da-kosta.iespana.es/directory/totano-sott.htm totano sott olio] [http://cakresen.angelfire.com/articles/houston-i.htm houston i like that] [http://eupnea.ibelgique.com/fai-come/ fai come ti pare max pezzali] [http://salpukka.isuisse.com/lib/tajumulco/ tajumulco] [http://grizs.iespana.es/articles/selettore-multiscart.htm selettore multiscart] [http://akyla-pera.isuisse.com/text/dimmi-che.htm dimmi che ci sei alex baroni] [http://pahopewe.angelfire.com/resources/decorare-la.htm decorare la stoffa] [http://ms-dirtnap.ibelgique.com/description/deadly-dozen/ deadly dozen] [http://iaa.ibelgique.com/blog/business-card.htm business card reader] [http://quarantined-x.iespana.es/view/www-usarci/ www usarci it] [http://mongo42.ibelgique.com/fx/ fx 5500] [http://mubathsh.angelfire.com/text/les-feuilles.htm les feuilles mortes] [http://callie-avalon.iespana.es/demm/ demm] [http://therealocelot.ibelgique.com/articles/appartamenti-in/ appartamenti in affitto parigi] [http://iaa.ibelgique.com/blog/norkis-batista.htm norkis batista] [http://mubathsh.angelfire.com/text/acido-retinoico.htm acido retinoico] [http://girlwithacurl.ibelgique.com/small/panca-pettorali.htm panca pettorali e addominali] [http://blaleyne.angelfire.com/new/sedili-usati.htm sedili usati] [http://arb-digits.iespana.es/web/foto-raf.htm foto raf] [http://stdamin.angelfire.com/resources/temps-modernes.htm temps modernes les] [http://salpukka.isuisse.com/lib/karine-anton/ karine anton] [http://scsheppe.angelfire.com/articles/pilot-v.htm pilot v5] [http://re-nrevival.isuisse.com/view/i-wanna.htm i wanna go] [http://killbox.ibelgique.com/html/viaccess-keys.htm viaccess2 keys] [http://bodendrucker.ibelgique.com/resources/daim/ daim] [http://masteriii.isuisse.com/pistas-tego.htm pistas tego calderon] [http://akyla-pera.isuisse.com/text/magnani.htm magnani] [http://marebeck.angelfire.com/new/hex-files/ hex files seca] [http://anryg.iespana.es/lib/gigaset-c.htm gigaset c250 siemens cordless] [http://songsoutofkey.isuisse.com/view/seno-grande.htm seno grande] [http://grizs.iespana.es/articles/vacanza-trentino.htm vacanza trentino montagna] [http://scsheppe.angelfire.com/articles/laquila.htm laquila] [http://flameshes.isuisse.com/topic/conversione-pdf/ conversione pdf word] [http://girlwithacurl.ibelgique.com/small/mx-pentax.htm mx4 pentax] [http://vanisky-love.iespana.es/resources/il-mio/ il mio eroe] [http://ravenmax.iespana.es/monton-de.htm monton de estrellas midi] [http://miki-hana.isuisse.com/description/esportazione-ciste/ esportazione ciste] [http://re-nrevival.isuisse.com/view/costantino-vitagliano.htm costantino vitagliano tv] [http://sarahxion.ibelgique.com/blog/gitiesse.htm gitiesse] [http://zelankom.iespana.es/nvidia-quadro/ nvidia quadro fx330] [http://bodendrucker.ibelgique.com/resources/logitech-/ logitech  pilot wheel mouse] [http://killbox.ibelgique.com/html/elmore-leonard.htm elmore leonard] [http://farshad-uk.isuisse.com/styles/vi-am.htm vi am] [http://grizs.iespana.es/articles/hotel-europa.htm hotel europa novara] [http://quarantined-x.iespana.es/view/orientale-uganda/ orientale (uganda)] [http://annie-fialochka.ibelgique.com/lib/elenco-telefonico.htm elenco telefonico svezia] [http://ana-princes.iespana.es/new/osama-bin/ osama bin laden captured] [[Category:Walnut|3]]
===Partial Ordering Of Sent Messages===
===Partial Ordering Of Sent Messages===

Revision as of 12:12, 10 September 2007

Partial Ordering Of Sent Messages

The above example moves the carRcvr around repeatedly and then asks for the amount of fuel remaining. This displays another important property of eventual sends: if object A sends several messages via a single reference to object B, it is guaranteed that those messages will arrive and be processed in the order of sending. This is only a partial ordering, however. From B's point of view, there are no guarantees that the messages from A will not be interspersed with messages from C, D, etc. Also, from A's point of view, there are no guarantees that, if A sends messages to both B and C, the message to B will arrive before (or after) the message to C, regardless of the order in which A initiates the messages. Furthermore, if A happens to have 2 different references to B (such as 2 promises that both will eventually resolve to B), the guarantee only applies to messages being sent down one reference.

Despite those uncertainties, however, in the example the partial ordering is sufficient to guarantee that fuelPromise will resolve to the quantity of fuel remaining after all three of the moveTo() operations have occurred. It also guarantees that those moveTo()s will have been performed in the specified sequence.

On first introduction, it is hard to fully appreciate the relationship between partial ordering and when-catch delayed activation. Here is a more sophisticated example.

 # E syntax
 def cars := [car1,car2,car3]
 for each in cars {
     def nameVow := each <- getName()
     def moveVow := each <- moveTo(3,4)
     when (nameVow, moveVow) -> {
         println(`Car $nameVow has arrived`)
     } catch e {println("A car did not make it")}
 println ("Cars have been told to move, but no print of any arrivals has yet occurred")   

In this example, getName and moveTo messages are sent to all the cars in the list in rapid-fire succession, never waiting for any answers to get back. The "Cars have been told to move" message at the bottom is guaranteed to print before any "has arrived" messages print. We cannot predict which of the 3 cars will arrive first, second, or third. It all depends on where they are running, how slow the connections are, how loaded the processors are. We cannot even predict which will receive the moveTo message first: though the program is guaranteed to fire off the message to car1 first, the processor upon which car1 executes might be several thousand miles away across the Internet, across a dozen bottlenecked routers. And car2 could be running on a computer two feet away, a short hop down an Ethernet connection. In that case car2 would probably be first to receive its message, and be first to actually arrive, and be the first to return its resolution so the arrival message could print--all three of those events being independent, and the first car to do one is not necessarily the first car to do the next.

Meanwhile, it is guaranteed that each car will get the getName message before it gets the moveTo message. It is not guaranteed that the nameVow will resolve to an answer before the moveVow has resolved, so you must use a multi-vow when-catch to use the name inside the when body with confidence. And if the moveTo promise is broken, which activates the catch clause, we do not know the resolution of the name--it could have fulfilled before the moveTo promise broke, or the name promise could be waiting (and on the verge of being broken or fulfilled) as well. We could use the E isBroken() function described later if we wanted to try to print the name of the car in the catch clause in those situations where the name was fulfilled though the moveTo was broken.

Also it is worth noting that the moveTo method, when used in an eventual send, returns a promise even though the moveTo method is of type "void" (i.e., "does not return a value"). This promise, if fulfilled, will always become the uninteresting value of null...but as shown in this example, sometimes it is valuable to know that fulfillment has occurred, or that fulfillment has failed, even if you do not care what the fulfilled value may be.

Sometimes you want to ensure that car1 arrives before car2, and car2 before car3. In a simple problem you could use nested when-catches, described later. In this example, where you don't necessarily know how many cars there are, you would use the recursive when-while pattern or the sendValve utility, both described at the end of the chapter.

Personal tools
more tools