The previous sub-section has illustrated how token-passing continuations work in message passing. This sub-section introduces join blocks which can specify a barrier for parallel processing activities and join their results in a subsequent message. A join continuation has a scope (or block) starting with "join{ " and ending with "}". Every message inside the block must be executed, and then the continuation message, following @, can be sent. For instance, the following example prints either "Hello World SALSA" or "WorldHello SALSA":
join { standardOutput <- print("Hello "); standardOutput <- print("World"); } @ standardOutput <- println(" SALSA"); |