OEP

127

Title

Native BARRIER support

Summary

Provide a native BARRIER synchronisation primitive.

Owner

Fred Barnes <F.R.M.Barnes@kent.ac.uk>

Status

Accepted

Date-Accepted

2005-02-26

Keywords

language barriers par

This extension provides a "BARRIER" type, used to synchronise multiple parallel processes (channels synchronise two processes only). Barriers may be declared and renamed (passed as parameters and abbreviated) like ordinary variables, but may not be communicated or assigned. Normal parallel-usage rules apply to barriers, except when a "PAR" construct extends a barrier (specified using "PAR BARRIER"). For example:

PROC foo (BARRIER x)
  SEQ
    SYNC x
    SYNC x
:

BARRIER b:
PAR BARRIER b
  foo (b)
  foo (b)

Processes may resign themselves from a barrier, but this introduces non-determinism. For example:

BARRIER b:
PAR BARRIER b
  SYNC b
  SEQ
    RESIGN b
      ...  do stuff without the barrier
    SYNC b

The default behaviour of the compiler is to resign parallel processes from the barrier as soon as they terminate -- without waiting for the whole "PAR" to terminate before resigning the processes.

OEP/127 (last edited 2007-09-27 00:43:02 by ats1)