next up previous contents
Next: First-class continuations Up: Coordinating Concurrency Previous: Token passing continuations   Contents


Join continuations

The previous sub-section has illustrated how token passing continuations work in message passing. This sub-section introduces join continuations which can specify the barrier of parallel processing and join the results in the next message following by @. A join continuation has a scope (or block) starting at "{join" and ending with "}". Every message inside the block must be executed, and then the next message, followed by @, can be started for execution. For instance, the following example shows either "Hello world SALSA" or "WorldHello SALSA":

 
join {
  standardOutput <- print("Hello ");  
  standardOutput <- print("World");
} @  standardOutput <- println(" SALSA");
 
   
Using the return token of the join block is much more complicated. It is explained in the Chapter 5.



Wei-Jen Wang 2005-10-24