Difference between revisions of "Wait"

From Mesham
Jump to navigationJump to search
(Created page with '== Overview == This wait(n) function will wait for a notification from process ''n'' * '''Pass:''' an Int representing the process ID to wait for a notification from * '''R…')
 
m (4 revisions imported)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
  
This wait(n) function will wait for a notification from process ''n''
+
This wait(n) function will block and wait for a notification from process ''n''
  
 
* '''Pass:''' an [[Int]] representing the process ID to wait for a notification from
 
* '''Pass:''' an [[Int]] representing the process ID to wait for a notification from
Line 12: Line 12:
 
  function void main() {
 
  function void main() {
 
     proc 1 {
 
     proc 1 {
       notify(1);
+
       notify(0);
 
     };
 
     };
 
+
 
   proc 0 {
 
   proc 0 {
       wait(0);
+
       wait(1);
 
     };
 
     };
 
  };
 
  };

Latest revision as of 15:45, 15 April 2019

Overview

This wait(n) function will block and wait for a notification from process n

  • Pass: an Int representing the process ID to wait for a notification from
  • Returns: Nothing

Example

#include <parallel>

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

  proc 0 {
      wait(1);
   };
};

Since: Version 1.00