@@ -405,16 +405,20 @@ \subsection{Monitoring for information flow}
405405we also carry the information about the chosen branch into the type label.
406406
407407\paragraph {Implicit flows and I/O }
408- The implicit information flows are further propagated between processes,
409- as one can see in this modification of the previous example.
408+ The implicit information flows are further propagated between processes.
409+ In the mailbox, each message is additionally tagged with a label that
410+ corresponds to the blocking level of the sender at the time when the message was sent.
411+ Troupe supports filtering messages based on these tags.
412+ In the following example, \code {rcvp} is a form of receive statement that selects messages
413+ where the pc-tag set to the provided label argument.
410414
411415\ begin{lstlisting}
412416let val x = 10 raisedTo {secret}
413417 val p = self()
414418 val _ = spawn ( fn () => if x > 0
415419 then send (p, 1)
416420 else send (p, 0) )
417- in receive [ hn x => x ]
421+ in rcvp ({secret}, [ hn x => x ])
418422end
419423\end {lstlisting }
420424\begin {verbatim }
@@ -566,9 +570,21 @@ \subsubsection{Declassification of the blocking level}
566570\code {pinipop} dynamically scope the part of the execution for which the blocking label is declassified.
567571
568572
573+ \subsection {Information flow control in I/O }
574+ \subsubsection {Generalized receive }
575+ Because receive operation changes the state of the mailbox, Troupe supports several forms
576+ of receive statement that was introduced earlier in Section~\ref {sec:concurrency }. The most
577+ general form for receiving is \code {rcv(lev1,lev2,auth,hns)}. Here, \code {lev1} and \code {lev2}
578+ indicate the to and from-levels of the pc-tags on the messages, and \code {auth} is the authority
579+ argument.
569580
570581
571582
583+ Note that if \code {lev1} and \code {lev2} coincide then the authority argument
584+ is not required. In such cases, one can use a special form of receive \code {rcvp}.
585+ Finally, note that the \code {receive} operation we introduced earlier is equivalent to \code {rcvp}
586+ at the level of the current pc label.
587+
572588\section {Networking }
573589\label {sec:network }
574590
@@ -614,8 +630,17 @@ \subsubsection{Registering and looking up processes}
614630end
615631\end {lstlisting }
616632
633+ \subsubsection {Aliases }
634+ Aliases is a mechanism that allows us to avoid having hardcoded node identifiers in the source code.
635+ The alias mechanism operates in the way of the traditional Unix hosts files.
636+ To use this mechanism, we need to provide the path to a special alias file that contains a mapping between
637+ alias strings and network identifiers. In the text of the program, an alias string must start with character~"@".
617638
618639
640+ \begin {verbatim }
641+ $TROUPE/rt/troupe out.js --aliases=<path_to_aliases_file>
642+ \end {verbatim }
643+
619644\subsection {Node trust levels }
620645
621646By default, all nodes in Troupe are mutually distrusting. This means that
@@ -624,7 +649,6 @@ \subsection{Node trust levels}
624649passing a trust map file that include the identity of the nodes and their maximum
625650trust level.
626651
627-
628652
629653\subsection {Remote spawning }
630654If we know of a node identifier, we can spawn a thread on that node. Remote spawning is
0 commit comments