Buffered

From Mesham
Revision as of 19:45, 10 January 2010 by Polas (talk | contribs) (Created page with '== Syntax == buffered[buffersize] == Semantics == This type will ensure that P2P Send will reach the finish state (i.e. complete) when the message is copied into a buffer of s…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Syntax

buffered[buffersize]

Semantics

This type will ensure that P2P Send will reach the finish state (i.e. complete) when the message is copied into a buffer of size buffersize bytes. At some later point the message will be sent to the target process. If buffersize is not provided then a default is used.

Example

var a:Int::allocated[single[on[1]]];
var b:Int::allocated[single[on[2]]] :: buffered[500];
var c:Int::allocated[single[on[2]]] :: buffered[500] :: nonblocking[];
a:=b;
a:=c;

The P2P communication resulting from assignment a:=b, process 2 will issue a (blocking) buffered send (buffer size 500 bytes), which will complete once the message has been copied into this buffer. The assignment a:=c, process 1 will issue another send this time also buffered but nonblocking where program flow will continue between the start and finish state of communication. The finish state will be reached once the value of variable c has been copied into a buffer held on process 2.