Difference between revisions of "Test notification"

From Mesham
Jump to navigationJump to search
(Created page with '== Overview == This test_notification(n) function will test for a notification from process ''n'', if such a notification is available then this is received (i.e. one need not t…')
 
m (3 revisions imported)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
  
This test_notification(n) function will test for a notification from process ''n'', if such a notification is available then this is received (i.e. one need not then call [[Wait|wait]] or [[Waitall|waitall]].
+
This test_notification(n) function will test for a notification from process ''n'', if such a notification is available then this is received (i.e. one need not then call [[Wait|wait]] or [[Waitany|waitany]].)
  
 
* '''Pass:''' an [[Int]] representing the process ID to test for a notification from
 
* '''Pass:''' an [[Int]] representing the process ID to test for a notification from

Latest revision as of 15:45, 15 April 2019

Overview

This test_notification(n) function will test for a notification from process n, if such a notification is available then this is received (i.e. one need not then call wait or waitany.)

  • Pass: an Int representing the process ID to test for a notification from
  • Returns: a Bool representing whether a notification was received or not

Example

#include <parallel>

function void main() {
   proc 1 {
      notify(0);
   };

  proc 0 {
      while (!test_notification(1)) { };
   };
};

Since: Version 1.00