Difference between revisions of "Blocking"

From Mesham
Jump to navigationJump to search
(Created page with '== Syntax == blocking[ ] == Semantics == Will force P2P communication to be blocking, which is the default setting == Example == var a:Int::allocated[single[on[1]]]; var b…')
 
m (5 revisions imported)
 
(4 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
== Example ==
 
== Example ==
  
  var a:Int::allocated[single[on[1]]];
+
  function void main() {
var b:Int::allocated[single[on[2]]] :: blocking[];
+
    var a:Int::allocated[single[on[1]]];
a:=b;
+
    var b:Int::allocated[single[on[2]]] :: blocking[];
 +
    a:=b;
 +
};
  
 
The P2P communication (send on process 2 and receive on process 1) resulting from assignment ''a:=b'' will force program flow to wait until it has completed. The ''blocking'' type has been omitted from the that of variable ''a'', but is used by default.
 
The P2P communication (send on process 2 and receive on process 1) resulting from assignment ''a:=b'' will force program flow to wait until it has completed. The ''blocking'' type has been omitted from the that of variable ''a'', but is used by default.
  
 +
''Since: Version 0.5''
  
 
[[Category:Type Library]]
 
[[Category:Type Library]]
[[Category:Composite Types]]
+
[[Category:Compound Types]]
 
[[Category:Communication Mode Types]]
 
[[Category:Communication Mode Types]]

Latest revision as of 15:44, 15 April 2019

Syntax

blocking[ ]

Semantics

Will force P2P communication to be blocking, which is the default setting

Example

function void main() {
   var a:Int::allocated[single[on[1]]];
   var b:Int::allocated[single[on[2]]] :: blocking[];
   a:=b;
};

The P2P communication (send on process 2 and receive on process 1) resulting from assignment a:=b will force program flow to wait until it has completed. The blocking type has been omitted from the that of variable a, but is used by default.

Since: Version 0.5