Broadcast

From Mesham
Revision as of 19:29, 10 January 2010 by Polas (talk | contribs) (Created page with '== Syntax == broadcast[root] == Semantics == This type will broadcast a variable amongst the processes, with the root (source) being PID=root. The variable concerned must eith…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Syntax

broadcast[root]

Semantics

This type will broadcast a variable amongst the processes, with the root (source) being PID=root. The variable concerned must either be allocated to all or a group of processes (in the later case communication will be limited to that group.)

Example

var a:Int::allocated[multiple[]];
var p;
par p from 0 to 3
{
   (a::broadcast[2]):=23;
};

In this example process 2 (the root) will broadcast the value 23 amongst the processes, each process receiving this value and placing it into their copy of a.