public class ProcessWriteInt
Writes one int to its output channel.
ProcessWriteInt declaration, construction and use should normally be localised within a single method -- so we feel no embarassment about its public field. Its only (envisaged) purpose is as described in the example below.
Output Channels | ||
---|---|---|
out | int | All channels in this package carry integers. |
ChannelOutputInt out0, out1; . . . ProcessWriteInt write0 = new ProcessWriteInt (out0); ProcessWriteInt write1 = new ProcessWriteInt (out1); CSProcess parWrite01 = new Parallel (new CSProcess[] {out0, out1});The above is best done once, before any looping over the parallel read commences. A parallel write can now be performed at any time (and any number of times) by executing:
write0.value = ...; // whatever we want sent down out0 write1.value = ...; // whatever we want sent down out1 parWrite01.run ();This terminates when, and only when, both writes have completed -- the events may occur in any order.
Modifiers | Name | Description |
---|---|---|
int |
value |
The int to be written to the channel |
Constructor and description |
---|
ProcessWriteInt
(ChannelOutputInt out) Construct a new ProcessWriteInt. |
Construct a new ProcessWriteInt.
out
- the channel to which to writeJCSP for Java 1.8 generated 14-10-2016 by Jon Kerridge, Edinburgh Napier University - j dot kerridge at napier dot ac dot uk