OEP

137

Title

Phased access syntax

Summary

Add PHASED process to control access to shared resources using barriers.

Owner

Peter Welch

Status

Proposed

Date-Proposed

2006-03-14

Keywords

language phases barriers

Experimentation with phased access control to shared resources using barriers has shown that it seems to work well; however, writing SYNCs by hand is error-prone and does not make the phase structure obvious. We need a convenient language binding for phases.

The best candidate at the moment looks like this:

PHASED
  barrier.1
    process
  barrier.1
    process

By explicitly specifying the barrier to be synchronised upon, this makes it possible to participate in multiple phase systems at the same time -- vitally important for composable concurrent components. The barriers must be declared separately above.

Resignation would be handled using RESIGN blocks; the language would guarantee that the process rejoined the phase system in the same phase (which is somewhat awkward to implement correctly with the current facilities).

Richard Bornat proposed this alternative, a "waisted PAR" in which parallel sets of processes alternate with single processes, with an implicit synchronisation before each single process:

WPAR i = 0 FOR num.procs
  par.process
  single.process
  par.process
  single.process
  ...

Another approach would be a "synchronised SEQ" with an implicit sync before each process:

SSEQ barrier
  process
  process
  ...

OEP/137 (last edited 2007-09-27 01:00:47 by ats1)